Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ public function processNodes(

Assert::allIsInstanceOf($stmts, Stmt::class);

$this->nodeTraverser->traverse($stmts);

$scope = $formerMutatingScope ?? $this->scopeFactory->createFromFile($filePath);

$nodeCallback = function (Node $node, MutatingScope $mutatingScope) use (
Expand Down Expand Up @@ -419,6 +417,10 @@ public function processNodes(
RectorNodeScopeResolver::processNodes($stmts, $scope);
}

// use after scope filling so DecoratingNodeVisitorInterface instance can fetch the scope of target node
// @see https://github.com/rectorphp/rector-src/pull/7721#discussion_r2595932460
$this->nodeTraverser->traverse($stmts);

return $stmts;
}

Expand Down