/** * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ParamTag can * understand the @param DocBlock. * * @param string $type * @param string $content * @param string $extractedType * @param string $extractedTypes * @param string $extractedVarName * @param string $extractedDescription * @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag * @dataProvider provideDataForConstructor * * @return void */ public function testConstructorParsesInputsIntoCorrectFields($type, $content, $extractedType, $extractedTypes, $extractedVarName, $extractedDescription) { $tag = new ParamTag($type, $content); $this->assertEquals($type, $tag->getName()); $this->assertEquals($extractedType, $tag->getType()); $this->assertEquals($extractedTypes, $tag->getTypes()); $this->assertEquals($extractedVarName, $tag->getVariableName()); $this->assertEquals($extractedDescription, $tag->getDescription()); }
private function parseTags($tags) { $lines = explode(PHP_EOL, $tags); foreach ($lines as $line) { if (preg_match('#^\\@param#', $line)) { $paramTag = new ParamTag($line); $this->params[$paramTag->getName()] = $paramTag; } elseif (preg_match('#^\\@return#', $line)) { $this->returnTag = new ReturnTag($line); } } }