Copied!

Provides a readable stream for a MessagePart.

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

Allow decorators to implement custom methods

  • return mixed
public __construct(ZBateson\MailMimeParser\Stream\StreamFactory $sdf, ZBateson\MailMimeParser\Message\IMessagePart $part, bool $throwExceptionReadingPartContentFromUnsupportedCharsets)
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
Properties
protected ?GuzzleHttp\Psr7\AppendStream $appendStream = NULL
 
  • var ?\AppendStream
protected ZBateson\MailMimeParser\Message\IMessagePart $part
 
  • var \IMessagePart The part to read from.
protected ?Psr\Http\Message\StreamInterface ZBateson\MailMimeParser\Stream\MessagePartStreamDecorator::$stream
protected ZBateson\MailMimeParser\Stream\StreamFactory $streamFactory
 
  • var \StreamFactory For creating needed stream decorators.
protected bool $throwExceptionReadingPartContentFromUnsupportedCharsets
 
  • var bool if false, saving a content stream with an unsupported charset will be written in the default charset, otherwise the stream will be created with the unsupported charset, and an exception will be thrown when read from.
Methods
protected createStream() : Psr\Http\Message\StreamInterface
 

Creates the underlying stream lazily when required.

protected getBoundaryAndChildStreams(ZBateson\MailMimeParser\Message\IMimePart $part) : array
 

Creates an array of streams based on the attached part's mime boundary and child streams.

  • param \IMimePart $part passed in because $this->part is declared as IMessagePart
  • return \StreamInterface[]
protected getStreamsArray() : array
 

Returns an array of Psr7 Streams representing the attached part and it's direct children.

  • return \StreamInterface[]
Methods
private getCharsetDecoratorForStream(Psr\Http\Message\StreamInterface $stream) : Psr\Http\Message\StreamInterface
 

Attaches and returns a CharsetStream decorator to the passed $stream.

If the current attached IMessagePart doesn't specify a charset, $stream is returned as-is.

© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration