diff --git a/rules-tests/Php80/Rector/Property/NestedAnnotationToAttributeRector/Fixture/merge_with_existing_attribute.php.inc b/rules-tests/Php80/Rector/Property/NestedAnnotationToAttributeRector/Fixture/merge_with_existing_attribute.php.inc new file mode 100644 index 00000000000..0d33ee69d1d --- /dev/null +++ b/rules-tests/Php80/Rector/Property/NestedAnnotationToAttributeRector/Fixture/merge_with_existing_attribute.php.inc @@ -0,0 +1,33 @@ + +----- + diff --git a/rules/Php80/Rector/Property/NestedAnnotationToAttributeRector.php b/rules/Php80/Rector/Property/NestedAnnotationToAttributeRector.php index eb778585c3c..432eeb72ce3 100644 --- a/rules/Php80/Rector/Property/NestedAnnotationToAttributeRector.php +++ b/rules/Php80/Rector/Property/NestedAnnotationToAttributeRector.php @@ -121,7 +121,7 @@ public function refactor(Node $node): ?Node return null; } - $node->attrGroups = $attributeGroups; + $node->attrGroups = array_merge($node->attrGroups, $attributeGroups); $this->completeExtraUseImports($attributeGroups); return $node;