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