diff --git a/rules-tests/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector/Fixture/reprint_same_line.php.inc b/rules-tests/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector/Fixture/reprint_same_line.php.inc deleted file mode 100644 index 14e4bb10..00000000 --- a/rules-tests/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector/Fixture/reprint_same_line.php.inc +++ /dev/null @@ -1,24 +0,0 @@ - ------ - \ No newline at end of file diff --git a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php index 5e8caeab..a673917c 100644 --- a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php +++ b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php @@ -106,14 +106,9 @@ public function refactor(Node $node): ?Node $this->isDowngraded = false; $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); - $requireReprint = false; foreach ($node->attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $key => $attribute) { if ($this->shouldSkipAttribute($attribute)) { - // avoid error on same line - // as attribute ->getStartLine() always equal with node ->getStartLine() - // can't validate it, so enforce to reprint later - $requireReprint = true; continue; } @@ -151,11 +146,6 @@ public function refactor(Node $node): ?Node $this->cleanupEmptyAttrGroups($node); if (! $this->isDowngraded) { - if ($requireReprint) { - $node->setAttribute(AttributeKey::ORIGINAL_NODE, null); - return $node; - } - return null; }