Skip to content

Commit 2a167da

Browse files
committed
Update NodeScopeResolver.php
1 parent 58abb96 commit 2a167da

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
@@ -2553,6 +2553,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
25532553
$scope = $nameResult->getScope();
25542554
$throwPoints = $nameResult->getThrowPoints();
25552555
$impurePoints = $nameResult->getImpurePoints();
2556+
$isAlwaysTerminating = $nameResult->isAlwaysTerminating();
25562557
if (
25572558
$nameType->isObject()->yes()
25582559
&& $nameType->isCallable()->yes()
@@ -2959,6 +2960,7 @@ static function (): void {
29592960
$hasYield = $classResult->hasYield();
29602961
$throwPoints = array_merge($throwPoints, $classResult->getThrowPoints());
29612962
$impurePoints = array_merge($impurePoints, $classResult->getImpurePoints());
2963+
$isAlwaysTerminating = $classResult->isAlwaysTerminating();
29622964
foreach ($additionalThrowPoints as $throwPoint) {
29632965
$throwPoints[] = $throwPoint;
29642966
}
@@ -3106,14 +3108,14 @@ static function (): void {
31063108
$hasYield = $result->hasYield();
31073109
$throwPoints = $result->getThrowPoints();
31083110
$impurePoints = $result->getImpurePoints();
3109-
$isAlwaysTerminating = false;
3111+
$isAlwaysTerminating = $result->isAlwaysTerminating();
31103112
$scope = $result->getScope();
31113113
if ($expr->name instanceof Expr) {
31123114
$result = $this->processExprNode($stmt, $expr->name, $scope, $nodeCallback, $context->enterDeep());
31133115
$hasYield = $hasYield || $result->hasYield();
31143116
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
31153117
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
3116-
$isAlwaysTerminating = $result->isAlwaysTerminating();
3118+
$isAlwaysTerminating = $isAlwaysTerminating || $result->isAlwaysTerminating();
31173119
$scope = $result->getScope();
31183120
if ($this->phpVersion->supportsPropertyHooks()) {
31193121
$throwPoints[] = ThrowPoint::createImplicit($scope, $expr);

0 commit comments

Comments
 (0)