streamFactory = $sdf; $this->partHeaderContainerFactory = $phcf; $this->parserPartStreamContainerFactory = $pscf; $this->parserPartChildrenContainerFactory = $ppccf; } /** * Constructs a new ParserMimePartProxy wrapping an IMimePart object that * will dynamically parse a message's content and parts as they're * requested. * * @return ParserMimePartProxy */ public function newInstance(PartBuilder $partBuilder, IParser $parser) { $parserProxy = new ParserMimePartProxy($partBuilder, $parser); $streamContainer = $this->parserPartStreamContainerFactory->newInstance($parserProxy); $headerContainer = $this->partHeaderContainerFactory->newInstance($parserProxy->getHeaderContainer()); $childrenContainer = $this->parserPartChildrenContainerFactory->newInstance($parserProxy); $part = new MimePart( $partBuilder->getParent()->getPart(), $streamContainer, $headerContainer, $childrenContainer ); $parserProxy->setPart($part); $streamContainer->setStream($this->streamFactory->newMessagePartStream($part)); $part->attach($streamContainer); return $parserProxy; } }