Copied!

Psr7 stream decorator implementation providing a readable stream for a part's headers.

HeaderStream is only used by a MimePart parent. It can accept any MessagePart - for non-MimeParts, only type headers are generated based on available information.

CloneableInstantiable
Methods
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::__call(string $method, array $args)
 

Allow decorators to implement custom methods

  • return mixed
public __construct(ZBateson\MailMimeParser\Message\IMessagePart $part)
public __destruct()
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::__get(string $name)
 

Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).

  • return \StreamInterface
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::__toString() : string
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::close() : void
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::detach()
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::eof() : bool
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::getContents() : string
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::getMetadata( $key = NULL)
 
  • return mixed
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::getSize() : ?int
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::isReadable() : bool
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::isSeekable() : bool
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::isWritable() : bool
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::read(int $length) : string
 

Overridden to wrap exceptions in MessagePartReadException which provides 'getPart' to inspect the part the error occurs on.

  • throws \MessagePartStreamReadException
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::rewind() : void
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::seek( $offset, $whence = 0GuzzleHttp\Psr7\SEEK_SET) : void
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::tell() : int
public update(SplSubject $subject) : void
public ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::write( $string) : int
public writePartHeadersTo(Psr\Http\Message\StreamInterface $stream) : static
 

Writes out headers for $this->part and follows them with an empty line.

Properties
protected ZBateson\MailMimeParser\Message\IMessagePart $part
 
  • var \IMessagePart the part to read from.
protected ?Psr\Http\Message\StreamInterface ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::$stream
Methods
protected createStream() : Psr\Http\Message\StreamInterface
 

Creates the underlying stream lazily when required.

Methods
private getPartHeadersIterator() : Traversable
 

Returns a header array for the current part.

If the part is not a MimePart, Content-Type, Content-Disposition and Content-Transfer-Encoding headers are generated manually.

© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration