public function getInstanceFor($type) { switch ($type) { case 'parser': return new PHPParser($this->master->getDocblockParser(), $this->master->getErrorHandler()); default: throw new FactoryException("'{$type}' is not a known backend."); } }
/** * @covers TheSeer\phpDox\Factory::getDocblockParser * @uses TheSeer\phpDox\DocBlock\Parser */ public function testgetDoclockParser() { $docBlock = $this->factory->getDocblockParser(); // lazy initialization included $this->assertInstanceOf('TheSeer\\phpDox\\DocBlock\\Parser', $docBlock); $this->assertSame($docBlock, $this->factory->getDocblockParser()); }