Add @template-covariant support

This commit is contained in:
Arnaud Le Blanc 2019-11-06 11:57:55 +01:00 committed by Ondřej Mirtes
parent 18b0e92b63
commit 3edb51540b
2 changed files with 18 additions and 0 deletions

View File

@ -161,6 +161,9 @@ class PhpDocParser
case '@template':
case '@phpstan-template':
case '@psalm-template':
case '@template-covariant':
case '@phpstan-template-covariant':
case '@psalm-template-covariant':
$tagValue = $this->parseTemplateTagValue($tokens);
break;

View File

@ -2371,6 +2371,21 @@ some text in the middle'
),
]),
];
yield [
'OK with covariance',
'/** @template-covariant T */',
new PhpDocNode([
new PhpDocTagNode(
'@template-covariant',
new TemplateTagValueNode(
'T',
null,
''
)
),
]),
];
}
public function provideExtendsTagsData(): \Iterator