From 5cd06e2239566b15aaa49e4139072541fc72ee1e Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Wed, 16 Aug 2023 12:57:13 +0200 Subject: [PATCH] Check out how this text gets parsed --- tests/PHPStan/Parser/PhpDocParserTest.php | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/PHPStan/Parser/PhpDocParserTest.php b/tests/PHPStan/Parser/PhpDocParserTest.php index 3139aec0..b448dc24 100644 --- a/tests/PHPStan/Parser/PhpDocParserTest.php +++ b/tests/PHPStan/Parser/PhpDocParserTest.php @@ -6448,6 +6448,24 @@ public function provideDoctrineWithoutDoctrineCheckData(): Iterator )), ]), ]; + + yield [ + 'Slevomat CS issue #1608', + '/**' . PHP_EOL . + ' * `"= "`' . PHP_EOL . + ' * a' . PHP_EOL . + ' * "' . PHP_EOL . + ' *' . PHP_EOL . + ' * @package foo' . PHP_EOL . + ' */', + new PhpDocNode([ + new PhpDocTextNode('`"= "`' . PHP_EOL . + ' * a' . PHP_EOL . + ' * "'), + new PhpDocTextNode(''), + new PhpDocTagNode('@package', new GenericTagValueNode('foo')), + ]), + ]; } public function provideSpecializedTags(): Iterator @@ -7079,6 +7097,23 @@ public function dataTextBetweenTagsBelongsToDescription(): iterable new PhpDocTextNode(''), ]), ]; + + yield [ + '/**' . PHP_EOL . + ' * `"= "`' . PHP_EOL . + ' * a' . PHP_EOL . + ' * "' . PHP_EOL . + ' *' . PHP_EOL . + ' * @package foo' . PHP_EOL . + ' */', + new PhpDocNode([ + new PhpDocTextNode('`"= "`' . PHP_EOL . + ' * a' . PHP_EOL . + ' * "'), + new PhpDocTextNode(''), + new PhpDocTagNode('@package', new GenericTagValueNode('foo')), + ]), + ]; } /**