@@ -3209,20 +3209,14 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
32093209 $ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
32103210 $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
32113211 } elseif ($ expr instanceof Expr \NullsafeMethodCall) {
3212- $ this ->processExprNode ($ stmt , new MethodCall (
3213- $ expr ->var ,
3214- $ expr ->name ,
3215- $ expr ->args ,
3216- ), $ scope , $ storage , new NoopNodeCallback (), $ context );
3217-
32183212 $ beforeScope = $ scope ;
32193213 $ nonNullabilityResult = $ this ->ensureShallowNonNullability ($ scope , $ scope , $ expr ->var );
32203214 $ exprResult = $ this ->processExprNode (
32213215 $ stmt ,
32223216 new MethodCall (
3223- $ this -> deepNodeCloner -> cloneNode ( $ expr ->var ) ,
3224- $ this -> deepNodeCloner -> cloneNode ( $ expr ->name ) ,
3225- array_map ( fn ( $ node ) => $ this -> deepNodeCloner -> cloneNode ( $ node ), $ expr ->args ) ,
3217+ $ expr ->var ,
3218+ $ expr ->name ,
3219+ $ expr ->args ,
32263220 array_merge ($ expr ->getAttributes (), ['virtualNullsafeMethodCall ' => true ]),
32273221 ),
32283222 $ nonNullabilityResult ->getScope (),
@@ -3443,16 +3437,11 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
34433437 }
34443438 }
34453439 } elseif ($ expr instanceof Expr \NullsafePropertyFetch) {
3446- $ this ->processExprNode ($ stmt , new PropertyFetch (
3447- $ expr ->var ,
3448- $ expr ->name ,
3449- ), $ scope , $ storage , new NoopNodeCallback (), $ context );
3450-
34513440 $ beforeScope = $ scope ;
34523441 $ nonNullabilityResult = $ this ->ensureShallowNonNullability ($ scope , $ scope , $ expr ->var );
34533442 $ exprResult = $ this ->processExprNode ($ stmt , new PropertyFetch (
3454- $ this -> deepNodeCloner -> cloneNode ( $ expr ->var ) ,
3455- $ this -> deepNodeCloner -> cloneNode ( $ expr ->name ) ,
3443+ $ expr ->var ,
3444+ $ expr ->name ,
34563445 array_merge ($ expr ->getAttributes (), ['virtualNullsafePropertyFetch ' => true ]),
34573446 ), $ nonNullabilityResult ->getScope (), $ storage , $ nodeCallback , $ context );
34583447 $ scope = $ this ->revertNonNullability ($ exprResult ->getScope (), $ nonNullabilityResult ->getSpecifiedExpressions ());
@@ -3661,10 +3650,9 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
36613650 $ this ->storeResult ($ storage , $ expr , $ result );
36623651 return $ result ;
36633652 } elseif ($ expr instanceof Coalesce) {
3664- $ this ->processExprNode ($ stmt , $ expr ->left , $ scope , $ storage , new NoopNodeCallback (), $ context ->enterDeep ());
36653653 $ nonNullabilityResult = $ this ->ensureNonNullability ($ scope , $ expr ->left );
36663654 $ condScope = $ this ->lookForSetAllowedUndefinedExpressions ($ nonNullabilityResult ->getScope (), $ expr ->left );
3667- $ condResult = $ this ->processExprNode ($ stmt , $ this -> deepNodeCloner -> cloneNode ( $ expr ->left ) , $ condScope , $ storage , $ nodeCallback , $ context ->enterDeep ());
3655+ $ condResult = $ this ->processExprNode ($ stmt , $ expr ->left , $ condScope , $ storage , $ nodeCallback , $ context ->enterDeep ());
36683656 $ scope = $ this ->revertNonNullability ($ condResult ->getScope (), $ nonNullabilityResult ->getSpecifiedExpressions ());
36693657 $ scope = $ this ->lookForUnsetAllowedUndefinedExpressions ($ scope , $ expr ->left );
36703658
@@ -3859,10 +3847,9 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
38593847 $ this ->callNodeCallback ($ nodeCallback , $ expr ->name , $ scope , $ storage );
38603848 }
38613849 } elseif ($ expr instanceof Expr \Empty_) {
3862- $ this ->processExprNode ($ stmt , $ expr ->expr , $ scope , $ storage , new NoopNodeCallback (), $ context ->enterDeep ());
38633850 $ nonNullabilityResult = $ this ->ensureNonNullability ($ scope , $ expr ->expr );
38643851 $ scope = $ this ->lookForSetAllowedUndefinedExpressions ($ nonNullabilityResult ->getScope (), $ expr ->expr );
3865- $ result = $ this ->processExprNode ($ stmt , $ this -> deepNodeCloner -> cloneNode ( $ expr ->expr ) , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
3852+ $ result = $ this ->processExprNode ($ stmt , $ expr ->expr , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
38663853 $ scope = $ result ->getScope ();
38673854 $ hasYield = $ result ->hasYield ();
38683855 $ throwPoints = $ result ->getThrowPoints ();
@@ -3877,10 +3864,9 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
38773864 $ nonNullabilityResults = [];
38783865 $ isAlwaysTerminating = false ;
38793866 foreach ($ expr ->vars as $ var ) {
3880- $ this ->processExprNode ($ stmt , $ var , $ scope , $ storage , new NoopNodeCallback (), $ context ->enterDeep ());
38813867 $ nonNullabilityResult = $ this ->ensureNonNullability ($ scope , $ var );
38823868 $ scope = $ this ->lookForSetAllowedUndefinedExpressions ($ nonNullabilityResult ->getScope (), $ var );
3883- $ result = $ this ->processExprNode ($ stmt , $ this -> deepNodeCloner -> cloneNode ( $ var) , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
3869+ $ result = $ this ->processExprNode ($ stmt , $ var , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
38843870 $ scope = $ result ->getScope ();
38853871 $ hasYield = $ hasYield || $ result ->hasYield ();
38863872 $ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
0 commit comments