Support @template-contravariant tags

This commit is contained in:
Alex Wells 2022-06-26 14:58:55 +03:00 committed by Ondřej Mirtes
parent 25ddf938d8
commit 135607f9cc
2 changed files with 18 additions and 0 deletions

View File

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

View File

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