MailMimeParser 4.0

HeaderStream extends MessagePartStreamDecorator
in package
implements SplObserver, StreamInterface

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.

Tags
author

Zaahid Bateson

Interfaces, Classes, Traits and Enums

SplObserver
StreamInterface

Table of Contents

$part  : IMessagePart
$stream  : StreamInterface|null
__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
writePartHeadersTo()  : static
Writes out headers for $this->part and follows them with an empty line.
createStream()  : StreamInterface
Creates the underlying stream lazily when required.
resolveStream()  : StreamInterface
Returns the underlying stream, lazily creating it via createStream() if not yet initialized.
getPartHeadersIterator()  : Traversable
Returns a header array for the current part.

Properties

Methods

__call()

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

__destruct()

public __destruct() : 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

writePartHeadersTo()

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

public writePartHeadersTo(StreamInterface $stream) : static
Parameters
$stream : StreamInterface
Return values
static

createStream()

Creates the underlying stream lazily when required.

protected createStream() : StreamInterface
Return values
StreamInterface

resolveStream()

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

protected resolveStream() : StreamInterface
Return values
StreamInterface

getPartHeadersIterator()

Returns a header array for the current part.

private getPartHeadersIterator() : Traversable

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

Return values
Traversable

Search results