/** * Pass in a reflection item (class, property, method) * and this function will build a parser and return its * results. * * @param ReflectionClass $classProperty * @return array all options */ private function _optionsFrom($classProperty) { $parser = new Pd_Map_Builder_Parser(); $parser->setString($classProperty->getDocComment()); $parser->setInfo($classProperty); $parser->match(); $parser->buildOptions(); return $parser->getOptions(); }
public function testMultipleCommands() { $this->parser->setString("/**\n * @PdInject Apple1\n * @PdInject Apple2 force:true\n * @PdInject Apple3\n */\n "); $this->parser->match(); $this->parser->buildOptions(); $options = $this->parser->getOptions(); $this->assertEquals('Apple1', $options[0]['dependencyName'], '0'); $this->assertEquals('true', $options[1]['force'], '1'); $this->assertEquals('Apple3', $options[2]['dependencyName'], '2'); }