diff --git a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_mixed_attribute_and_annotations.php.inc b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_mixed_attribute_and_annotations.php.inc new file mode 100644 index 00000000000..e1f701a0279 --- /dev/null +++ b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_mixed_attribute_and_annotations.php.inc @@ -0,0 +1,43 @@ + +----- + diff --git a/rules/Php80/Rector/Class_/AttributeValueResolver.php b/rules/Php80/Rector/Class_/AttributeValueResolver.php index df26cb4b8b0..077d1b45e9b 100644 --- a/rules/Php80/Rector/Class_/AttributeValueResolver.php +++ b/rules/Php80/Rector/Class_/AttributeValueResolver.php @@ -32,7 +32,9 @@ public function resolve( if ($phpDocTagNode->value instanceof DoctrineAnnotationTagValueNode) { $originalContent = (string) $phpDocTagNode->value->getOriginalContent(); - if ($docValue !== '') { + if ($docValue === '') { + $docValue = $originalContent; + } else { $attributeComment = ltrim($originalContent, $docValue); if ($attributeComment !== '') { $docValue .= "\n" . $attributeComment;