@@ -1913,7 +1913,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
1913
1913
$ nodeCallback ($ node , $ scope );
1914
1914
},
1915
1915
ExpressionContext::createDeep (),
1916
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
1916
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
1917
1917
false ,
1918
1918
)->getScope ();
1919
1919
} elseif ($ var instanceof PropertyFetch) {
@@ -2473,7 +2473,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
2473
2473
$ scope = $ scope ->exitExpressionAssign ($ expr ->expr );
2474
2474
}
2475
2475
2476
- return new ExpressionResult ($ scope , $ hasYield , $ throwPoints , $ impurePoints , isAlwaysTerminating: $ isAlwaysTerminating );
2476
+ return new ExpressionResult ($ scope , $ hasYield , $ isAlwaysTerminating , $ throwPoints , $ impurePoints );
2477
2477
},
2478
2478
true ,
2479
2479
);
@@ -2511,9 +2511,9 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
2511
2511
return new ExpressionResult (
2512
2512
$ result ->getScope ()->mergeWith ($ originalScope ),
2513
2513
$ result ->hasYield (),
2514
+ $ result ->isAlwaysTerminating (),
2514
2515
$ result ->getThrowPoints (),
2515
2516
$ result ->getImpurePoints (),
2516
- isAlwaysTerminating: $ result ->isAlwaysTerminating (),
2517
2517
);
2518
2518
}
2519
2519
@@ -2931,6 +2931,7 @@ static function (): void {
2931
2931
return new ExpressionResult (
2932
2932
$ scope ,
2933
2933
$ exprResult ->hasYield (),
2934
+ false ,
2934
2935
$ exprResult ->getThrowPoints (),
2935
2936
$ exprResult ->getImpurePoints (),
2936
2937
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
@@ -3133,6 +3134,7 @@ static function (): void {
3133
3134
return new ExpressionResult (
3134
3135
$ scope ,
3135
3136
$ exprResult ->hasYield (),
3137
+ false ,
3136
3138
$ exprResult ->getThrowPoints (),
3137
3139
$ exprResult ->getImpurePoints (),
3138
3140
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
@@ -3170,6 +3172,7 @@ static function (): void {
3170
3172
return new ExpressionResult (
3171
3173
$ processClosureResult ->getScope (),
3172
3174
false ,
3175
+ false ,
3173
3176
[],
3174
3177
[],
3175
3178
);
@@ -3178,6 +3181,7 @@ static function (): void {
3178
3181
return new ExpressionResult (
3179
3182
$ result ->getScope (),
3180
3183
$ result ->hasYield (),
3184
+ false ,
3181
3185
[],
3182
3186
[],
3183
3187
);
@@ -3274,6 +3278,7 @@ static function (): void {
3274
3278
return new ExpressionResult (
3275
3279
$ leftMergedWithRightScope ,
3276
3280
$ leftResult ->hasYield () || $ rightResult ->hasYield (),
3281
+ false ,
3277
3282
array_merge ($ leftResult ->getThrowPoints (), $ rightResult ->getThrowPoints ()),
3278
3283
array_merge ($ leftResult ->getImpurePoints (), $ rightResult ->getImpurePoints ()),
3279
3284
static fn (): MutatingScope => $ rightResult ->getScope ()->filterByTruthyValue ($ expr ),
@@ -3294,6 +3299,7 @@ static function (): void {
3294
3299
return new ExpressionResult (
3295
3300
$ leftMergedWithRightScope ,
3296
3301
$ leftResult ->hasYield () || $ rightResult ->hasYield (),
3302
+ false ,
3297
3303
array_merge ($ leftResult ->getThrowPoints (), $ rightResult ->getThrowPoints ()),
3298
3304
array_merge ($ leftResult ->getImpurePoints (), $ rightResult ->getImpurePoints ()),
3299
3305
static fn (): MutatingScope => $ leftMergedWithRightScope ->filterByTruthyValue ($ expr ),
@@ -3492,7 +3498,7 @@ static function (): void {
3492
3498
}
3493
3499
} elseif ($ expr instanceof List_) {
3494
3500
// only in assign and foreach, processed elsewhere
3495
- return new ExpressionResult ($ scope , false , [], []);
3501
+ return new ExpressionResult ($ scope , false , false , [], []);
3496
3502
} elseif ($ expr instanceof New_) {
3497
3503
$ parametersAcceptor = null ;
3498
3504
$ constructorReflection = null ;
@@ -3644,7 +3650,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
3644
3650
$ nodeCallback ($ node , $ scope );
3645
3651
},
3646
3652
$ context ,
3647
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
3653
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
3648
3654
false ,
3649
3655
)->getScope ();
3650
3656
} elseif ($ expr instanceof Ternary) {
@@ -3689,6 +3695,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
3689
3695
return new ExpressionResult (
3690
3696
$ finalScope ,
3691
3697
$ ternaryCondResult ->hasYield (),
3698
+ false ,
3692
3699
$ throwPoints ,
3693
3700
$ impurePoints ,
3694
3701
static fn (): MutatingScope => $ finalScope ->filterByTruthyValue ($ expr ),
@@ -4018,11 +4025,11 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
4018
4025
return new ExpressionResult (
4019
4026
$ scope ,
4020
4027
$ hasYield ,
4028
+ $ isAlwaysTerminating ,
4021
4029
$ throwPoints ,
4022
4030
$ impurePoints ,
4023
4031
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
4024
4032
static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
4025
- $ isAlwaysTerminating ,
4026
4033
);
4027
4034
}
4028
4035
@@ -4739,7 +4746,7 @@ private function processArrowFunctionNode(
4739
4746
$ nodeCallback (new InArrowFunctionNode ($ arrowFunctionType , $ expr ), $ arrowFunctionScope );
4740
4747
$ exprResult = $ this ->processExprNode ($ stmt , $ expr ->expr , $ arrowFunctionScope , $ nodeCallback , ExpressionContext::createTopLevel ());
4741
4748
4742
- return new ExpressionResult ($ scope , false , $ exprResult ->getThrowPoints (), $ exprResult ->getImpurePoints ());
4749
+ return new ExpressionResult ($ scope , false , false , $ exprResult ->getThrowPoints (), $ exprResult ->getImpurePoints ());
4743
4750
}
4744
4751
4745
4752
/**
@@ -5261,7 +5268,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
5261
5268
$ nodeCallback ($ node , $ scope );
5262
5269
},
5263
5270
$ context ,
5264
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
5271
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
5265
5272
true ,
5266
5273
);
5267
5274
$ scope = $ result ->getScope ();
@@ -5294,7 +5301,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
5294
5301
}
5295
5302
}
5296
5303
5297
- return new ExpressionResult ($ scope , $ hasYield , $ throwPoints , $ impurePoints , isAlwaysTerminating: $ isAlwaysTerminating );
5304
+ return new ExpressionResult ($ scope , $ hasYield , $ isAlwaysTerminating , $ throwPoints , $ impurePoints );
5298
5305
}
5299
5306
5300
5307
/**
@@ -5853,7 +5860,7 @@ static function (): void {
5853
5860
new GetOffsetValueTypeExpr ($ assignedExpr , $ dimExpr ),
5854
5861
$ nodeCallback ,
5855
5862
$ context ,
5856
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
5863
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
5857
5864
$ enterExpressionAssign ,
5858
5865
);
5859
5866
$ scope = $ result ->getScope ();
@@ -5939,7 +5946,7 @@ static function (): void {
5939
5946
}
5940
5947
}
5941
5948
5942
- return new ExpressionResult ($ scope , $ hasYield , $ throwPoints , $ impurePoints , isAlwaysTerminating: $ isAlwaysTerminating );
5949
+ return new ExpressionResult ($ scope , $ hasYield , $ isAlwaysTerminating , $ throwPoints , $ impurePoints );
5943
5950
}
5944
5951
5945
5952
/**
@@ -6249,7 +6256,7 @@ private function enterForeach(MutatingScope $scope, MutatingScope $originalScope
6249
6256
static function (): void {
6250
6257
},
6251
6258
ExpressionContext::createDeep (),
6252
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
6259
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
6253
6260
true ,
6254
6261
)->getScope ();
6255
6262
$ vars = $ this ->getAssignedVariables ($ stmt ->valueVar );
@@ -6267,7 +6274,7 @@ static function (): void {
6267
6274
static function (): void {
6268
6275
},
6269
6276
ExpressionContext::createDeep (),
6270
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
6277
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
6271
6278
true ,
6272
6279
)->getScope ();
6273
6280
$ vars = array_merge ($ vars , $ this ->getAssignedVariables ($ stmt ->keyVar ));
0 commit comments