mirror of
https://github.com/danog/phpdoc-parser.git
synced 2025-01-22 13:51:20 +01:00
Parse assert-if-true and assert-if-false as well
This commit is contained in:
parent
0af5cba9f1
commit
47051f5ca6
@ -206,7 +206,11 @@ class PhpDocParser
|
||||
break;
|
||||
|
||||
case '@phpstan-assert':
|
||||
case '@phpstan-assert-if-true':
|
||||
case '@phpstan-assert-if-false':
|
||||
case '@psalm-assert':
|
||||
case '@psalm-assert-if-true':
|
||||
case '@psalm-assert-if-false':
|
||||
$tagValue = $this->parseAssertTagValue($tokens);
|
||||
break;
|
||||
|
||||
|
@ -3565,6 +3565,35 @@ some text in the middle'
|
||||
),
|
||||
]),
|
||||
];
|
||||
|
||||
yield [
|
||||
'OK assert-if-true',
|
||||
'/** @phpstan-assert-if-true Type $var */',
|
||||
new PhpDocNode([
|
||||
new PhpDocTagNode(
|
||||
'@phpstan-assert-if-true',
|
||||
new AssertTagValueNode(
|
||||
new IdentifierTypeNode('Type'),
|
||||
'$var',
|
||||
''
|
||||
)
|
||||
),
|
||||
]),
|
||||
];
|
||||
yield [
|
||||
'OK assert-if-false',
|
||||
'/** @phpstan-assert-if-false Type $var */',
|
||||
new PhpDocNode([
|
||||
new PhpDocTagNode(
|
||||
'@phpstan-assert-if-false',
|
||||
new AssertTagValueNode(
|
||||
new IdentifierTypeNode('Type'),
|
||||
'$var',
|
||||
''
|
||||
)
|
||||
),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
public function providerDebug(): Iterator
|
||||
|
Loading…
x
Reference in New Issue
Block a user