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
Interfaces, Classes, Traits and Enums
- SplObserver
- StreamInterface
Table of Contents
- $part : IMessagePart
- $stream : StreamInterface|null
- __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
- writePartHeadersTo() : static
- Writes out headers for $this->part and follows them with an empty line.
- createStream() : StreamInterface
- Creates the underlying stream lazily when required.
- getPartHeadersIterator() : Traversable
- Returns a header array for the current part.
Properties
$part
protected
IMessagePart
$part
the part to read from.
$stream
protected
StreamInterface|null
$stream
Methods
__construct()
public
__construct(IMessagePart $part) : mixed
Parameters
- $part : IMessagePart
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —read()
Overridden to wrap exceptions in MessagePartReadException which provides 'getPart' to inspect the part the error occurs on.
public
read(int $length) : string
Parameters
- $length : int
Tags
Return values
string —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 —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.