Skip to content

Commit 621e168

Browse files
committed
Optimization - do not enter anonymous classes during loop analysis
1 parent 28cac3b commit 621e168

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Analyser/NodeScopeResolver.php

+3
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,9 @@ private function processStmtNode(
846846
} elseif ($stmt instanceof Node\Stmt\Trait_) {
847847
return new StatementResult($scope, false, false, [], [], []);
848848
} elseif ($stmt instanceof Node\Stmt\ClassLike) {
849+
if (!$context->isTopLevel()) {
850+
return new StatementResult($scope, false, false, [], [], []);
851+
}
849852
$hasYield = false;
850853
$throwPoints = [];
851854
$impurePoints = [];

0 commit comments

Comments
 (0)