Skip to content

Commit 0411b4b

Browse files
committed
[internal] Traverse DecoratingNodeVisitorInterface after scope filling on PHPStanNodeScopeResolver::processNodes()
1 parent 2c3d565 commit 0411b4b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ public function processNodes(
155155

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

158-
$this->nodeTraverser->traverse($stmts);
159-
160158
$scope = $formerMutatingScope ?? $this->scopeFactory->createFromFile($filePath);
161159

162160
$nodeCallback = function (Node $node, MutatingScope $mutatingScope) use (
@@ -419,6 +417,9 @@ public function processNodes(
419417
RectorNodeScopeResolver::processNodes($stmts, $scope);
420418
}
421419

420+
// use after scope filling DecoratingNodeVisitorInterface can can fetch the scope of target node
421+
$this->nodeTraverser->traverse($stmts);
422+
422423
return $stmts;
423424
}
424425

0 commit comments

Comments
 (0)