@@ -2552,7 +2552,6 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
25522552 $ scope = $ nameResult ->getScope ();
25532553 $ throwPoints = $ nameResult ->getThrowPoints ();
25542554 $ impurePoints = $ nameResult ->getImpurePoints ();
2555- $ isAlwaysTerminating = $ nameResult ->isAlwaysTerminating ();
25562555 if (
25572556 $ nameType ->isObject ()->yes ()
25582557 && $ nameType ->isCallable ()->yes ()
@@ -2568,7 +2567,7 @@ static function (): void {
25682567 );
25692568 $ throwPoints = array_merge ($ throwPoints , $ invokeResult ->getThrowPoints ());
25702569 $ impurePoints = array_merge ($ impurePoints , $ invokeResult ->getImpurePoints ());
2571- $ isAlwaysTerminating = $ isAlwaysTerminating || $ invokeResult ->isAlwaysTerminating ();
2570+ $ isAlwaysTerminating = $ invokeResult ->isAlwaysTerminating ();
25722571 } elseif ($ parametersAcceptor instanceof CallableParametersAcceptor) {
25732572 $ callableThrowPoints = array_map (static fn (SimpleThrowPoint $ throwPoint ) => $ throwPoint ->isExplicit () ? ThrowPoint::createExplicit ($ scope , $ throwPoint ->getType (), $ expr , $ throwPoint ->canContainAnyThrowable ()) : ThrowPoint::createImplicit ($ scope , $ expr ), $ parametersAcceptor ->getThrowPoints ());
25742573 if (!$ this ->implicitThrows ) {
@@ -2815,6 +2814,7 @@ static function (): void {
28152814 $ hasYield = $ result ->hasYield ();
28162815 $ throwPoints = $ result ->getThrowPoints ();
28172816 $ impurePoints = $ result ->getImpurePoints ();
2817+ $ isAlwaysTerminating = $ result ->isAlwaysTerminating ();
28182818 $ scope = $ result ->getScope ();
28192819 if (isset ($ closureCallScope )) {
28202820 $ scope = $ scope ->restoreOriginalScopeAfterClosureBind ($ originalScope );
@@ -2921,6 +2921,7 @@ static function (): void {
29212921 $ hasYield = $ hasYield || $ result ->hasYield ();
29222922 $ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
29232923 $ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
2924+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
29242925 } elseif ($ expr instanceof Expr \NullsafeMethodCall) {
29252926 $ nonNullabilityResult = $ this ->ensureShallowNonNullability ($ scope , $ scope , $ expr ->var );
29262927 $ 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 {
30943095 $ hasYield = $ hasYield || $ result ->hasYield ();
30953096 $ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
30963097 $ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
3098+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
30973099 } elseif ($ expr instanceof PropertyFetch) {
30983100 $ scopeBeforeVar = $ scope ;
30993101 $ result = $ this ->processExprNode ($ stmt , $ expr ->var , $ scope , $ nodeCallback , $ context ->enterDeep ());
0 commit comments