Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f3e2a98

Browse files
Add tests for template bound + default
1 parent fdc8a6d commit f3e2a98

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

‎tests/PHPStan/Parser/PhpDocParserTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3361,6 +3361,38 @@ public function provideTemplateTagsData(): Iterator
33613361
),
33623362
]),
33633363
];
3364+
3365+
yield [
3366+
'OK with default and description',
3367+
'/** @template T = string the value type */',
3368+
new PhpDocNode([
3369+
new PhpDocTagNode(
3370+
'@template',
3371+
new TemplateTagValueNode(
3372+
'T',
3373+
null,
3374+
'the value type',
3375+
new IdentifierTypeNode('string')
3376+
)
3377+
),
3378+
]),
3379+
];
3380+
3381+
yield [
3382+
'OK with bound and default and description',
3383+
'/** @template T of string = \'\' the value type */',
3384+
new PhpDocNode([
3385+
new PhpDocTagNode(
3386+
'@template',
3387+
new TemplateTagValueNode(
3388+
'T',
3389+
new IdentifierTypeNode('string'),
3390+
'the value type',
3391+
new ConstTypeNode(new ConstExprStringNode(''))
3392+
)
3393+
),
3394+
]),
3395+
];
33643396
}
33653397

33663398
public function provideExtendsTagsData(): Iterator

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /