Skip to content

Commit 180c665

Browse files
committed
Update NodeScopeResolver.php
1 parent 26f888b commit 180c665

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
25552555
$scope = $nameResult->getScope();
25562556
$throwPoints = $nameResult->getThrowPoints();
25572557
$impurePoints = $nameResult->getImpurePoints();
2558+
$isAlwaysTerminating = $nameResult->isAlwaysTerminating();
25582559
if (
25592560
$nameType->isObject()->yes()
25602561
&& $nameType->isCallable()->yes()
@@ -2961,6 +2962,7 @@ static function (): void {
29612962
$hasYield = $classResult->hasYield();
29622963
$throwPoints = array_merge($throwPoints, $classResult->getThrowPoints());
29632964
$impurePoints = array_merge($impurePoints, $classResult->getImpurePoints());
2965+
$isAlwaysTerminating = $classResult->isAlwaysTerminating();
29642966
foreach ($additionalThrowPoints as $throwPoint) {
29652967
$throwPoints[] = $throwPoint;
29662968
}
@@ -3108,14 +3110,14 @@ static function (): void {
31083110
$hasYield = $result->hasYield();
31093111
$throwPoints = $result->getThrowPoints();
31103112
$impurePoints = $result->getImpurePoints();
3111-
$isAlwaysTerminating = false;
3113+
$isAlwaysTerminating = $result->isAlwaysTerminating();
31123114
$scope = $result->getScope();
31133115
if ($expr->name instanceof Expr) {
31143116
$result = $this->processExprNode($stmt, $expr->name, $scope, $nodeCallback, $context->enterDeep());
31153117
$hasYield = $hasYield || $result->hasYield();
31163118
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
31173119
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
3118-
$isAlwaysTerminating = $result->isAlwaysTerminating();
3120+
$isAlwaysTerminating = $isAlwaysTerminating || $result->isAlwaysTerminating();
31193121
$scope = $result->getScope();
31203122
if ($this->phpVersion->supportsPropertyHooks()) {
31213123
$throwPoints[] = ThrowPoint::createImplicit($scope, $expr);

0 commit comments

Comments
 (0)