diff --git a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/FixturePhp81/new_line_after_open_parentheses.php.inc b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/FixturePhp81/new_line_after_open_parentheses.php.inc new file mode 100644 index 00000000000..81266381064 --- /dev/null +++ b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/FixturePhp81/new_line_after_open_parentheses.php.inc @@ -0,0 +1,28 @@ + +----- + diff --git a/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php b/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php index ae9a9cebf23..d560b2dce01 100644 --- a/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php +++ b/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php @@ -485,6 +485,10 @@ private function resolveAnnotationContent(string $annotationContent, array $nest return $annotationContent; } + if ($trimmedNestedAnnotationOpen === '') { + return $annotationContent; + } + return '("' . trim($trimmedNestedAnnotationOpen, '"\'') . '")'; } }