diff --git a/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser.php b/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser.php index 0feaf5797a9..e3cad26dfb4 100644 --- a/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser.php +++ b/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser.php @@ -102,6 +102,10 @@ private function resolveAnnotationValues(BetterTokenIterator $tokenIterator): ar if (is_array($nestedValues)) { $values = array_merge($values, $nestedValues); } else { + if ($tokenIterator->isCurrentTokenType(Lexer::TOKEN_END)) { + break; + } + $values[] = $nestedValues; } } diff --git a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Doctrine/trailing_comma.php.inc b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Doctrine/trailing_comma.php.inc new file mode 100644 index 00000000000..8a0aad36349 --- /dev/null +++ b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Doctrine/trailing_comma.php.inc @@ -0,0 +1,29 @@ + +----- +