@@ -2554,7 +2554,6 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
2554
2554
$ scope = $ nameResult ->getScope ();
2555
2555
$ throwPoints = $ nameResult ->getThrowPoints ();
2556
2556
$ impurePoints = $ nameResult ->getImpurePoints ();
2557
- $ isAlwaysTerminating = $ nameResult ->isAlwaysTerminating ();
2558
2557
if (
2559
2558
$ nameType ->isObject ()->yes ()
2560
2559
&& $ nameType ->isCallable ()->yes ()
@@ -2570,7 +2569,7 @@ static function (): void {
2570
2569
);
2571
2570
$ throwPoints = array_merge ($ throwPoints , $ invokeResult ->getThrowPoints ());
2572
2571
$ impurePoints = array_merge ($ impurePoints , $ invokeResult ->getImpurePoints ());
2573
- $ isAlwaysTerminating = $ isAlwaysTerminating || $ invokeResult ->isAlwaysTerminating ();
2572
+ $ isAlwaysTerminating = $ invokeResult ->isAlwaysTerminating ();
2574
2573
} elseif ($ parametersAcceptor instanceof CallableParametersAcceptor) {
2575
2574
$ callableThrowPoints = array_map (static fn (SimpleThrowPoint $ throwPoint ) => $ throwPoint ->isExplicit () ? ThrowPoint::createExplicit ($ scope , $ throwPoint ->getType (), $ expr , $ throwPoint ->canContainAnyThrowable ()) : ThrowPoint::createImplicit ($ scope , $ expr ), $ parametersAcceptor ->getThrowPoints ());
2576
2575
if (!$ this ->implicitThrows ) {
@@ -2818,6 +2817,7 @@ static function (): void {
2818
2817
$ hasYield = $ result ->hasYield ();
2819
2818
$ throwPoints = $ result ->getThrowPoints ();
2820
2819
$ impurePoints = $ result ->getImpurePoints ();
2820
+ $ isAlwaysTerminating = $ result ->isAlwaysTerminating ();
2821
2821
$ scope = $ result ->getScope ();
2822
2822
if (isset ($ closureCallScope )) {
2823
2823
$ scope = $ scope ->restoreOriginalScopeAfterClosureBind ($ originalScope );
@@ -2924,6 +2924,7 @@ static function (): void {
2924
2924
$ hasYield = $ hasYield || $ result ->hasYield ();
2925
2925
$ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
2926
2926
$ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
2927
+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
2927
2928
} elseif ($ expr instanceof Expr \NullsafeMethodCall) {
2928
2929
$ nonNullabilityResult = $ this ->ensureShallowNonNullability ($ scope , $ scope , $ expr ->var );
2929
2930
$ exprResult = $ this ->processExprNode ($ stmt , new MethodCall ($ expr ->var , $ expr ->name , $ expr ->args , array_merge ($ expr ->getAttributes (), ['virtualNullsafeMethodCall ' => true ])), $ nonNullabilityResult ->getScope (), $ nodeCallback , $ context );
@@ -3097,6 +3098,7 @@ static function (): void {
3097
3098
$ hasYield = $ hasYield || $ result ->hasYield ();
3098
3099
$ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
3099
3100
$ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
3101
+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
3100
3102
} elseif ($ expr instanceof PropertyFetch) {
3101
3103
$ scopeBeforeVar = $ scope ;
3102
3104
$ result = $ this ->processExprNode ($ stmt , $ expr ->var , $ scope , $ nodeCallback , $ context ->enterDeep ());
0 commit comments