Skip to content

Commit f13af95

Browse files
committed
Fix standalone Throw_ expr handling
1 parent 598a82d commit f13af95

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,9 @@ private function processStmtNode(
791791
new StatementExitPoint($stmt, $scope),
792792
], $overridingThrowPoints ?? $throwPoints, $impurePoints);
793793
} elseif ($stmt instanceof Node\Stmt\Expression) {
794+
if ($stmt->expr instanceof Expr\Throw_) {
795+
$scope = $stmtScope;
796+
}
794797
$earlyTerminationExpr = $this->findEarlyTerminatingExpr($stmt->expr, $scope);
795798
$hasAssign = false;
796799
$currentScope = $scope;

0 commit comments

Comments
 (0)