Skip to content

Commit

Permalink
Optimization - do not enter anonymous classes during loop analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 9, 2024
1 parent 28cac3b commit 621e168
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@ private function processStmtNode(
} elseif ($stmt instanceof Node\Stmt\Trait_) {
return new StatementResult($scope, false, false, [], [], []);
} elseif ($stmt instanceof Node\Stmt\ClassLike) {
if (!$context->isTopLevel()) {
return new StatementResult($scope, false, false, [], [], []);
}
$hasYield = false;
$throwPoints = [];
$impurePoints = [];
Expand Down

0 comments on commit 621e168

Please sign in to comment.