MessageParserService
in package
Parses a mail mime message into its component parts. To invoke, call {@see MailMimeParser::parse()}.
Tags
Table of Contents
- $headerParser : HeaderParserService
- $parserManager : ParserManagerService
- $partBuilderFactory : PartBuilderFactory
- $partHeaderContainerFactory : PartHeaderContainerFactory
- __construct() : mixed
- parse() : IMessage
- Parses the passed stream into an {@see ZBateson\MailMimeParser\IMessage} object and returns it.
- readLine() : string|false
- Convenience method to read a line of up to 4096 characters from the passed resource handle.
Properties
$headerParser
protected
HeaderParserService
$headerParser
To parse the headers into a PartHeaderContainer.
$parserManager
protected
ParserManagerService
$parserManager
To figure out what parser is responsible for parsing a message.
$partBuilderFactory
protected
PartBuilderFactory
$partBuilderFactory
To create a PartBuilder representing this message, and to pass it to ParserManager.
$partHeaderContainerFactory
protected
PartHeaderContainerFactory
$partHeaderContainerFactory
To create a container to read the message's headers into.
Methods
__construct()
public
__construct(PartBuilderFactory $pbf, PartHeaderContainerFactory $phcf, ParserManagerService $pm, HeaderParserService $hp) : mixed
Parameters
- $pbf : PartBuilderFactory
- $phcf : PartHeaderContainerFactory
- $pm : ParserManagerService
- $hp : HeaderParserService
Return values
mixed —parse()
Parses the passed stream into an {@see ZBateson\MailMimeParser\IMessage} object and returns it.
public
parse(StreamInterface $stream) : IMessage
Parameters
- $stream : StreamInterface
-
the stream to parse the message from
Return values
IMessage —readLine()
Convenience method to read a line of up to 4096 characters from the passed resource handle.
public
static readLine(resource $handle) : string|false
If the line is larger than 4096 characters, the remaining characters in the line are read and discarded, and only the first 4096 characters are returned.
Parameters
- $handle : resource
Return values
string|false —the read line or false on EOF or on error.