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