Copied!

Provides basic implementations for:

  • IParser::setParserManager
  • IParser::getParserMessageProxyFactory (returns $this->parserMessageProxyFactory which can be set via the default constructor)
  • IParser::getParserPartProxyFactory (returns $this->parserPartProxyFactory which can be set via the default constructor)
Abstract
Methods
public __construct(ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxyFactory $parserMessageProxyFactory, ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxyFactory $parserPartProxyFactory, ZBateson\MailMimeParser\Parser\PartBuilderFactory $partBuilderFactory)
public abstract ZBateson\MailMimeParser\Parser\IParserService::canParse(ZBateson\MailMimeParser\Parser\PartBuilder $part) : bool
 

Called by the ParserManager to determine if the passed PartBuilder is a part handled by this IParser.

public getParserMessageProxyFactory() : ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxyFactory
public getParserPartProxyFactory() : ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxyFactory
public abstract ZBateson\MailMimeParser\Parser\IParserService::parseContent(ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy $proxy) : static
 

Performs read operations for content from the stream of the passed ParserPartProxy, and setting content bounds for the part in the passed ParserPartProxy.

The implementation should call $proxy->setStreamContentStartPos() and $proxy->setStreamContentAndPartEndPos() so an IMessagePart can return content from the raw message.

Reading should stop once the end of the current part's content has been reached or the end of the message has been reached. If the end of the message has been reached $proxy->setEof() should be called in addition to setStreamContentAndPartEndPos().

public abstract ZBateson\MailMimeParser\Parser\IParserService::parseNextChild(ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy $proxy) : ?ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy
 

Performs read operations to read children from the passed $proxy, using its stream, and reading up to (and not including) the beginning of the child's content if another child exists.

The implementation should:

  1. Return null if there are no more children.
  2. Read headers
  3. Create a PartBuilder (adding the passed $proxy as its parent)
  4. Call ParserManager::createParserProxyFor() on the ParserManager previously set by a call to setParserManager(), which may determine that a different parser is responsible for parts represented by the headers and PartBuilder passed to it.

The method should then return the ParserPartProxy returned by the ParserManager, or null if there are no more children to read.

  • return \ParserPartProxy|null The child ParserPartProxy or null if there are no more children under $proxy.
public setParserManager(ZBateson\MailMimeParser\Parser\ParserManagerService $pm) : static
Properties
protected ZBateson\MailMimeParser\Parser\ParserManagerService $parserManager
 
  • var \ParserManagerService the ParserManager, which should call setParserManager when the parser is added.
protected ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxyFactory $parserMessageProxyFactory
 
  • var \ParserPartProxyFactory the parser's message proxy factory service responsible for creating an IMessage part wrapped in a ParserPartProxy.
protected ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxyFactory $parserPartProxyFactory
 
  • var \ParserPartProxyFactory the parser's part proxy factory service responsible for creating IMessagePart parts wrapped in a ParserPartProxy.
protected ZBateson\MailMimeParser\Parser\PartBuilderFactory $partBuilderFactory
 
  • var \PartBuilderFactory Service for creating PartBuilder objects for new children.
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration