@@ -982,9 +982,7 @@ private function resolveType(string $exprString, Expr $node): Type
982982 }
983983
984984 if ($ this ->getBooleanExpressionDepth ($ node ->left ) <= self ::BOOLEAN_EXPRESSION_MAX_PROCESS_DEPTH ) {
985- $ noopCallback = static function (): void {
986- };
987- $ leftResult = $ this ->nodeScopeResolver ->processExprNode (new Node \Stmt \Expression ($ node ->left ), $ node ->left , $ this , $ noopCallback , ExpressionContext::createDeep ());
985+ $ leftResult = $ this ->nodeScopeResolver ->processExprNode (new Node \Stmt \Expression ($ node ->left ), $ node ->left , $ this , new ExpressionResultStorage (), new NoopNodeCallback (), ExpressionContext::createDeep ());
988986 $ rightBooleanType = $ leftResult ->getTruthyScope ()->getType ($ node ->right )->toBoolean ();
989987 } else {
990988 $ rightBooleanType = $ this ->filterByTruthyValue ($ node ->left )->getType ($ node ->right )->toBoolean ();
@@ -1014,9 +1012,7 @@ private function resolveType(string $exprString, Expr $node): Type
10141012 }
10151013
10161014 if ($ this ->getBooleanExpressionDepth ($ node ->left ) <= self ::BOOLEAN_EXPRESSION_MAX_PROCESS_DEPTH ) {
1017- $ noopCallback = static function (): void {
1018- };
1019- $ leftResult = $ this ->nodeScopeResolver ->processExprNode (new Node \Stmt \Expression ($ node ->left ), $ node ->left , $ this , $ noopCallback , ExpressionContext::createDeep ());
1015+ $ leftResult = $ this ->nodeScopeResolver ->processExprNode (new Node \Stmt \Expression ($ node ->left ), $ node ->left , $ this , new ExpressionResultStorage (), new NoopNodeCallback (), ExpressionContext::createDeep ());
10201016 $ rightBooleanType = $ leftResult ->getFalseyScope ()->getType ($ node ->right )->toBoolean ();
10211017 } else {
10221018 $ rightBooleanType = $ this ->filterByFalseyValue ($ node ->left )->getType ($ node ->right )->toBoolean ();
@@ -1406,6 +1402,7 @@ private function resolveType(string $exprString, Expr $node): Type
14061402 new Node \Stmt \Expression ($ node ->expr ),
14071403 $ node ->expr ,
14081404 $ arrowScope ,
1405+ new ExpressionResultStorage (),
14091406 static function (Node $ node , Scope $ scope ) use ($ arrowScope , &$ arrowFunctionImpurePoints , &$ invalidateExpressions ): void {
14101407 if ($ scope ->getAnonymousFunctionReflection () !== $ arrowScope ->getAnonymousFunctionReflection ()) {
14111408 return ;
@@ -2042,9 +2039,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
20422039 }
20432040
20442041 if ($ node instanceof Expr \Ternary) {
2045- $ noopCallback = static function (): void {
2046- };
2047- $ condResult = $ this ->nodeScopeResolver ->processExprNode (new Node \Stmt \Expression ($ node ->cond ), $ node ->cond , $ this , $ noopCallback , ExpressionContext::createDeep ());
2042+ $ condResult = $ this ->nodeScopeResolver ->processExprNode (new Node \Stmt \Expression ($ node ->cond ), $ node ->cond , $ this , new ExpressionResultStorage (), new NoopNodeCallback (), ExpressionContext::createDeep ());
20482043 if ($ node ->if === null ) {
20492044 $ conditionType = $ this ->getType ($ node ->cond );
20502045 $ booleanConditionType = $ conditionType ->toBoolean ();
0 commit comments