MailMimeParser 3.0

MessagePartStream extends MessagePartStreamDecorator
in package
implements SplObserver, StreamInterface

Provides a readable stream for a MessagePart.

Tags
author

Zaahid Bateson

Interfaces, Classes, Traits and Enums

SplObserver
StreamInterface

Table of Contents

$appendStream  : AppendStream|null
$part  : IMessagePart
$stream  : StreamInterface|null
$streamFactory  : StreamFactory
$throwExceptionReadingPartContentFromUnsupportedCharsets  : bool
__construct()  : mixed
__destruct()  : mixed
read()  : string
Overridden to wrap exceptions in MessagePartReadException which provides 'getPart' to inspect the part the error occurs on.
update()  : void
createStream()  : StreamInterface
Creates the underlying stream lazily when required.
getBoundaryAndChildStreams()  : array<string|int, StreamInterface>
Creates an array of streams based on the attached part's mime boundary and child streams.
getStreamsArray()  : array<string|int, StreamInterface>
Returns an array of Psr7 Streams representing the attached part and it's direct children.
getCharsetDecoratorForStream()  : StreamInterface
Attaches and returns a CharsetStream decorator to the passed $stream.

Properties

$throwExceptionReadingPartContentFromUnsupportedCharsets

protected bool $throwExceptionReadingPartContentFromUnsupportedCharsets

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

update()

public update(SplSubject $subject) : void
Parameters
$subject : SplSubject
Return values
void

createStream()

Creates the underlying stream lazily when required.

protected createStream() : StreamInterface
Return values
StreamInterface

getBoundaryAndChildStreams()

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

protected getBoundaryAndChildStreams(IMimePart $part) : array<string|int, StreamInterface>
Parameters
$part : IMimePart

passed in because $this->part is declared as IMessagePart

Return values
array<string|int, StreamInterface>

getStreamsArray()

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

protected getStreamsArray() : array<string|int, StreamInterface>
Return values
array<string|int, StreamInterface>

getCharsetDecoratorForStream()

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

private getCharsetDecoratorForStream(StreamInterface $stream) : StreamInterface

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

Parameters
$stream : StreamInterface
Return values
StreamInterface

Search results