Parse template tag for generics (#21)

* Parse template tag for generics

* Fixed templatetag docblock

* Fixed PHP 7 issue

* Fixed PHP 7.2 issue

* Fixed another 7.2 issue
This commit is contained in:
Nereo Berardozzi
2024-12-24 12:30:50 +01:00
committed by GitHub
parent fba297a2a7
commit d5d2d76892
8 changed files with 295 additions and 5 deletions
@@ -336,4 +336,22 @@ DOCBLOCK;
$this->assertCount(1, $object->getTagsByName('return'));
$this->assertCount(2, $object->getTagsByName('param'));
}
/**
* @covers \Barryvdh\Reflection\DocBlock::parseTags
*
* @return void
*/
public function testGenericsAreParsed()
{
$fixture = <<<DOCBLOCK
/**
* @template TValue
* @param TValue
* @return TValue
*/
DOCBLOCK;
$object = new DocBlock($fixture);
$this->assertSame(array('TValue'), $object->getGenerics());
}
}