Skip to content

Commit dd74df9

Browse files
committed
Revert reprint same line on DowngradeAttributeToAnnotationRector
1 parent f6caa1d commit dd74df9

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

rules-tests/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector/Fixture/reprint_same_line.php.inc

Lines changed: 0 additions & 24 deletions
This file was deleted.

rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,9 @@ public function refactor(Node $node): ?Node
106106
$this->isDowngraded = false;
107107

108108
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);
109-
$requireReprint = false;
110109
foreach ($node->attrGroups as $attrGroup) {
111110
foreach ($attrGroup->attrs as $key => $attribute) {
112111
if ($this->shouldSkipAttribute($attribute)) {
113-
// avoid error on same line
114-
// as attribute ->getStartLine() always equal with node ->getStartLine()
115-
// can't validate it, so enforce to reprint later
116-
$requireReprint = true;
117112
continue;
118113
}
119114

@@ -151,11 +146,6 @@ public function refactor(Node $node): ?Node
151146
$this->cleanupEmptyAttrGroups($node);
152147

153148
if (! $this->isDowngraded) {
154-
if ($requireReprint) {
155-
$node->setAttribute(AttributeKey::ORIGINAL_NODE, null);
156-
return $node;
157-
}
158-
159149
return null;
160150
}
161151

0 commit comments

Comments
 (0)