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.

public __call(string $method, array $args)

Allow decorators to implement custom methods

  • return mixed
public __construct(ZBateson\MailMimeParser\Message\IMessagePart $part)
public __destruct()
public __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 __toString() : string
public close() : void
public detach()
public eof() : bool
public getContents() : string
public getMetadata( $key = NULL)
  • return mixed
public getSize() : ?int
public isReadable() : bool
public isSeekable() : bool
public isWritable() : bool
public read( $length) : string
public rewind() : void
public seek( $offset, $whence = 0GuzzleHttp\Psr7\SEEK_SET) : void
public tell() : int
public update(SplSubject $subject) : void
public write( $string) : int
public writePartHeadersTo(Psr\Http\Message\StreamInterface $stream) : self

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

protected $part = NULL
  • var \IMessagePart the part to read from.
protected createStream() : Psr\Http\Message\StreamInterface

Creates the underlying stream lazily when required.

private getPartHeadersIterator() : Iterator

Returns a header array for the current part.

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

© 2024 Bruce Wells
Search Namespaces \ Classes