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 a5e938b

Browse files
Test for special multiline PHPDoc
1 parent 5d48fa4 commit a5e938b

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

‎tests/PHPStan/Parser/PhpDocParserTest.php‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3881,6 +3881,46 @@ public function provideMultiLinePhpDocData(): iterable
38813881
new PhpDocTextNode('test'),
38823882
]),
38833883
];
3884+
3885+
yield [
3886+
'Real-world test case multiline PHPDoc',
3887+
'/**' . PHP_EOL .
3888+
' *' . PHP_EOL .
3889+
' * MultiLine' . PHP_EOL .
3890+
' * description' . PHP_EOL .
3891+
' * @param bool $a' . PHP_EOL .
3892+
' *' . PHP_EOL .
3893+
' * @return void' . PHP_EOL .
3894+
' *' . PHP_EOL .
3895+
' * @throws \Exception' . PHP_EOL .
3896+
' *' . PHP_EOL .
3897+
' */',
3898+
new PhpDocNode([
3899+
new PhpDocTextNode(''),
3900+
new PhpDocTextNode(
3901+
'MultiLine' . PHP_EOL .
3902+
'description'
3903+
),
3904+
new PhpDocTagNode('@param', new ParamTagValueNode(
3905+
new IdentifierTypeNode('bool'),
3906+
false,
3907+
'$a',
3908+
'',
3909+
false
3910+
)),
3911+
new PhpDocTextNode(''),
3912+
new PhpDocTagNode('@return', new ReturnTagValueNode(
3913+
new IdentifierTypeNode('void'),
3914+
''
3915+
)),
3916+
new PhpDocTextNode(''),
3917+
new PhpDocTagNode('@throws', new ThrowsTagValueNode(
3918+
new IdentifierTypeNode('\Exception'),
3919+
''
3920+
)),
3921+
new PhpDocTextNode(''),
3922+
]),
3923+
];
38843924
}
38853925

38863926
public function provideTemplateTagsData(): Iterator
@@ -7582,6 +7622,45 @@ public function dataTextBetweenTagsBelongsToDescription(): iterable
75827622
),
75837623
]),
75847624
];
7625+
7626+
yield [
7627+
'/**' . PHP_EOL .
7628+
' *' . PHP_EOL .
7629+
' * MultiLine' . PHP_EOL .
7630+
' * description' . PHP_EOL .
7631+
' * @param bool $a' . PHP_EOL .
7632+
' *' . PHP_EOL .
7633+
' * @return void' . PHP_EOL .
7634+
' *' . PHP_EOL .
7635+
' * @throws \Exception' . PHP_EOL .
7636+
' *' . PHP_EOL .
7637+
' */',
7638+
new PhpDocNode([
7639+
new PhpDocTextNode(
7640+
PHP_EOL .
7641+
'MultiLine' . PHP_EOL .
7642+
'description'
7643+
),
7644+
new PhpDocTagNode('@param', new ParamTagValueNode(
7645+
new IdentifierTypeNode('bool'),
7646+
false,
7647+
'$a',
7648+
'',
7649+
false
7650+
)),
7651+
new PhpDocTextNode(''),
7652+
new PhpDocTagNode('@return', new ReturnTagValueNode(
7653+
new IdentifierTypeNode('void'),
7654+
''
7655+
)),
7656+
new PhpDocTextNode(''),
7657+
new PhpDocTagNode('@throws', new ThrowsTagValueNode(
7658+
new IdentifierTypeNode('\Exception'),
7659+
''
7660+
)),
7661+
new PhpDocTextNode(''),
7662+
]),
7663+
];
75857664
}
75867665

75877666
/**

0 commit comments

Comments
(0)

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