Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.23.x' into 2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 15, 2024
2 parents 0fe292d + a5e938b commit 769ba88
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions tests/PHPStan/Parser/PhpDocParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3953,6 +3953,46 @@ public function provideMultiLinePhpDocData(): iterable
),
]),
];

yield [
'Real-world test case multiline PHPDoc',
'/**' . PHP_EOL .
' *' . PHP_EOL .
' * MultiLine' . PHP_EOL .
' * description' . PHP_EOL .
' * @param bool $a' . PHP_EOL .
' *' . PHP_EOL .
' * @return void' . PHP_EOL .
' *' . PHP_EOL .
' * @throws \Exception' . PHP_EOL .
' *' . PHP_EOL .
' */',
new PhpDocNode([
new PhpDocTextNode(''),
new PhpDocTextNode(
'MultiLine' . PHP_EOL .
'description',
),
new PhpDocTagNode('@param', new ParamTagValueNode(
new IdentifierTypeNode('bool'),
false,
'$a',
'',
false,
)),
new PhpDocTextNode(''),
new PhpDocTagNode('@return', new ReturnTagValueNode(
new IdentifierTypeNode('void'),
'',
)),
new PhpDocTextNode(''),
new PhpDocTagNode('@throws', new ThrowsTagValueNode(
new IdentifierTypeNode('\Exception'),
'',
)),
new PhpDocTextNode(''),
]),
];
}

public function provideTemplateTagsData(): Iterator
Expand Down Expand Up @@ -7509,6 +7549,45 @@ public function dataTextBetweenTagsBelongsToDescription(): iterable
),
]),
];

yield [
'/**' . PHP_EOL .
' *' . PHP_EOL .
' * MultiLine' . PHP_EOL .
' * description' . PHP_EOL .
' * @param bool $a' . PHP_EOL .
' *' . PHP_EOL .
' * @return void' . PHP_EOL .
' *' . PHP_EOL .
' * @throws \Exception' . PHP_EOL .
' *' . PHP_EOL .
' */',
new PhpDocNode([
new PhpDocTextNode(''),
new PhpDocTextNode(
'MultiLine' . PHP_EOL .
'description',
),
new PhpDocTagNode('@param', new ParamTagValueNode(
new IdentifierTypeNode('bool'),
false,
'$a',
'',
false,
)),
new PhpDocTextNode(''),
new PhpDocTagNode('@return', new ReturnTagValueNode(
new IdentifierTypeNode('void'),
'',
)),
new PhpDocTextNode(''),
new PhpDocTagNode('@throws', new ThrowsTagValueNode(
new IdentifierTypeNode('\Exception'),
'',
)),
new PhpDocTextNode(''),
]),
];
}

/**
Expand Down

0 comments on commit 769ba88

Please sign in to comment.