Skip to content

Commit

Permalink
[Core] Ensure reindex node attributes even on re-print (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed May 30, 2023
1 parent 105df5f commit b37e273
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Rector/AbstractRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,7 @@ final public function enterNode(Node $node)
$this->printCurrentFileAndRule();
}

$originalNode = $node->getAttribute(AttributeKey::ORIGINAL_NODE);
if ($originalNode instanceof Node) {
$this->changedNodeScopeRefresher->reIndexNodeAttributes($node);
}
$this->changedNodeScopeRefresher->reIndexNodeAttributes($node);

if ($isDebug) {
$startTime = microtime(true);
Expand All @@ -247,6 +244,7 @@ final public function enterNode(Node $node)
throw new ShouldNotHappenException($errorMessage);
}

$originalNode = $node->getAttribute(AttributeKey::ORIGINAL_NODE);
return $this->postRefactorProcess($originalNode, $node, $refactoredNode);
}

Expand Down

0 comments on commit b37e273

Please sign in to comment.