MailMimeParser 4.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
__call()  : mixed
__construct()  : mixed
__destruct()  : mixed
__get()  : StreamInterface
__toString()  : string
close()  : void
detach()  : mixed
eof()  : bool
getContents()  : string
getMetadata()  : mixed
getSize()  : int|null
isReadable()  : bool
isSeekable()  : bool
isWritable()  : bool
read()  : string
Overridden to wrap exceptions in MessagePartReadException which provides 'getPart' to inspect the part the error occurs on.
rewind()  : void
seek()  : void
tell()  : int
update()  : void
write()  : int
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.
resolveStream()  : StreamInterface
Returns the underlying stream, lazily creating it via createStream() if not yet initialized.
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

__call()

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>
Return values
mixed

__get()

public __get(string $name) : StreamInterface
Parameters
$name : string
Return values
StreamInterface

getMetadata()

public getMetadata([mixed $key = null ]) : mixed
Parameters
$key : mixed = null
Return values
mixed

seek()

public seek(mixed $offset[, mixed $whence = SEEK_SET ]) : void
Parameters
$offset : mixed
$whence : mixed = SEEK_SET
Return values
void

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>

resolveStream()

Returns the underlying stream, lazily creating it via createStream() if not yet initialized.

protected resolveStream() : StreamInterface
Return values
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