NonMimeParserService
extends AbstractParserService
in package
Parses content for non-mime messages and uu-encoded child parts.
Tags
Table of Contents
- $parserManager : ParserManagerService
- $parserMessageProxyFactory : ParserPartProxyFactory
- $parserPartProxyFactory : ParserPartProxyFactory
- $partBuilderFactory : PartBuilderFactory
- $partHeaderContainerFactory : UUEncodedPartHeaderContainerFactory
- __construct() : mixed
- canParse() : bool
- Always returns true, and should therefore be the last parser reached by a ParserManager.
- getParserMessageProxyFactory() : ParserPartProxyFactory
- Returns the ParserPartProxyFactory responsible for creating IMessage parts for this parser.
- getParserPartProxyFactory() : ParserPartProxyFactory
- Returns the ParserPartProxyFactory responsible for creating IMessagePart parts for this parser.
- parseContent() : static
- parseNextChild() : ParserPartProxy|null
- setParserManager() : static
- Sets up the passed ParserManager as the ParserManager for this part, which should be used when a new part is created (after its headers are read and a PartBuilder is created from it.)
- createPart() : ParserPartProxy
- Creates a UUEncodedPartHeaderContainer attached to a PartBuilder, and calls $this->parserManager->createParserProxyFor().
- parseNextPart() : static
- Reads content from the passed ParserPartProxy's stream till a uu-encoded 'begin' line is found, setting $proxy->setStreamPartContentAndEndPos() to the last byte read before the begin line.
Properties
$parserManager
protected
ParserManagerService
$parserManager
the ParserManager, which should call setParserManager when the parser is added.
$parserMessageProxyFactory
protected
ParserPartProxyFactory
$parserMessageProxyFactory
the parser's message proxy factory service responsible for creating an IMessage part wrapped in a ParserPartProxy.
$parserPartProxyFactory
protected
ParserPartProxyFactory
$parserPartProxyFactory
the parser's part proxy factory service responsible for creating IMessagePart parts wrapped in a ParserPartProxy.
$partBuilderFactory
protected
PartBuilderFactory
$partBuilderFactory
Service for creating PartBuilder objects for new children.
$partHeaderContainerFactory
protected
UUEncodedPartHeaderContainerFactory
$partHeaderContainerFactory
Methods
__construct()
public
__construct(ParserNonMimeMessageProxyFactory $parserNonMimeMessageProxyFactory, ParserUUEncodedPartProxyFactory $parserUuEncodedPartProxyFactory, PartBuilderFactory $partBuilderFactory, UUEncodedPartHeaderContainerFactory $uuEncodedPartHeaderContainerFactory) : mixed
Parameters
- $parserNonMimeMessageProxyFactory : ParserNonMimeMessageProxyFactory
- $parserUuEncodedPartProxyFactory : ParserUUEncodedPartProxyFactory
- $partBuilderFactory : PartBuilderFactory
- $uuEncodedPartHeaderContainerFactory : UUEncodedPartHeaderContainerFactory
Return values
mixed —canParse()
Always returns true, and should therefore be the last parser reached by a ParserManager.
public
canParse(PartBuilder $part) : bool
Parameters
- $part : PartBuilder
Return values
bool —getParserMessageProxyFactory()
Returns the ParserPartProxyFactory responsible for creating IMessage parts for this parser.
public
getParserMessageProxyFactory() : ParserPartProxyFactory
This is called by ParserManager after 'canParse' if it returns true so a ParserPartProxy can be created out of the PartBuilder.
Return values
ParserPartProxyFactory —getParserPartProxyFactory()
Returns the ParserPartProxyFactory responsible for creating IMessagePart parts for this parser.
public
getParserPartProxyFactory() : ParserPartProxyFactory
This is called by ParserManager after 'canParse' if it returns true so a ParserPartProxy can be created out of the PartBuilder.
Return values
ParserPartProxyFactory —parseContent()
public
parseContent(ParserPartProxy $proxy) : static
Parameters
- $proxy : ParserPartProxy
Return values
static —parseNextChild()
public
parseNextChild(ParserMimePartProxy $proxy) : ParserPartProxy|null
Parameters
- $proxy : ParserMimePartProxy
Return values
ParserPartProxy|null —setParserManager()
Sets up the passed ParserManager as the ParserManager for this part, which should be used when a new part is created (after its headers are read and a PartBuilder is created from it.)
public
setParserManager(ParserManagerService $pm) : static
Parameters
- $pm : ParserManagerService
-
The ParserManager to set.
Return values
static —createPart()
Creates a UUEncodedPartHeaderContainer attached to a PartBuilder, and calls $this->parserManager->createParserProxyFor().
private
createPart(ParserNonMimeMessageProxy $parent) : ParserPartProxy
It also sets the PartBuilder's stream part start pos and content start pos to that of $parent->getNextParStart() (since a 'begin' line is read prior to another child being created, see parseNextPart()).
Parameters
- $parent : ParserNonMimeMessageProxy
Return values
ParserPartProxy —parseNextPart()
Reads content from the passed ParserPartProxy's stream till a uu-encoded 'begin' line is found, setting $proxy->setStreamPartContentAndEndPos() to the last byte read before the begin line.
private
parseNextPart(ParserNonMimeMessageProxy|ParserUUEncodedPartProxy $proxy) : static