@@ -1915,7 +1915,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
1915
1915
$ nodeCallback ($ node , $ scope );
1916
1916
},
1917
1917
ExpressionContext::createDeep (),
1918
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
1918
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
1919
1919
false ,
1920
1920
)->getScope ();
1921
1921
} elseif ($ var instanceof PropertyFetch) {
@@ -2475,7 +2475,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
2475
2475
$ scope = $ scope ->exitExpressionAssign ($ expr ->expr );
2476
2476
}
2477
2477
2478
- return new ExpressionResult ($ scope , $ hasYield , $ throwPoints , $ impurePoints , isAlwaysTerminating: $ isAlwaysTerminating );
2478
+ return new ExpressionResult ($ scope , $ hasYield , $ isAlwaysTerminating , $ throwPoints , $ impurePoints );
2479
2479
},
2480
2480
true ,
2481
2481
);
@@ -2513,9 +2513,9 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
2513
2513
return new ExpressionResult (
2514
2514
$ result ->getScope ()->mergeWith ($ originalScope ),
2515
2515
$ result ->hasYield (),
2516
+ $ result ->isAlwaysTerminating (),
2516
2517
$ result ->getThrowPoints (),
2517
2518
$ result ->getImpurePoints (),
2518
- isAlwaysTerminating: $ result ->isAlwaysTerminating (),
2519
2519
);
2520
2520
}
2521
2521
@@ -2933,6 +2933,7 @@ static function (): void {
2933
2933
return new ExpressionResult (
2934
2934
$ scope ,
2935
2935
$ exprResult ->hasYield (),
2936
+ false ,
2936
2937
$ exprResult ->getThrowPoints (),
2937
2938
$ exprResult ->getImpurePoints (),
2938
2939
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
@@ -3135,6 +3136,7 @@ static function (): void {
3135
3136
return new ExpressionResult (
3136
3137
$ scope ,
3137
3138
$ exprResult ->hasYield (),
3139
+ false ,
3138
3140
$ exprResult ->getThrowPoints (),
3139
3141
$ exprResult ->getImpurePoints (),
3140
3142
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
@@ -3172,6 +3174,7 @@ static function (): void {
3172
3174
return new ExpressionResult (
3173
3175
$ processClosureResult ->getScope (),
3174
3176
false ,
3177
+ false ,
3175
3178
[],
3176
3179
[],
3177
3180
);
@@ -3180,6 +3183,7 @@ static function (): void {
3180
3183
return new ExpressionResult (
3181
3184
$ result ->getScope (),
3182
3185
$ result ->hasYield (),
3186
+ false ,
3183
3187
[],
3184
3188
[],
3185
3189
);
@@ -3276,6 +3280,7 @@ static function (): void {
3276
3280
return new ExpressionResult (
3277
3281
$ leftMergedWithRightScope ,
3278
3282
$ leftResult ->hasYield () || $ rightResult ->hasYield (),
3283
+ false ,
3279
3284
array_merge ($ leftResult ->getThrowPoints (), $ rightResult ->getThrowPoints ()),
3280
3285
array_merge ($ leftResult ->getImpurePoints (), $ rightResult ->getImpurePoints ()),
3281
3286
static fn (): MutatingScope => $ rightResult ->getScope ()->filterByTruthyValue ($ expr ),
@@ -3296,6 +3301,7 @@ static function (): void {
3296
3301
return new ExpressionResult (
3297
3302
$ leftMergedWithRightScope ,
3298
3303
$ leftResult ->hasYield () || $ rightResult ->hasYield (),
3304
+ false ,
3299
3305
array_merge ($ leftResult ->getThrowPoints (), $ rightResult ->getThrowPoints ()),
3300
3306
array_merge ($ leftResult ->getImpurePoints (), $ rightResult ->getImpurePoints ()),
3301
3307
static fn (): MutatingScope => $ leftMergedWithRightScope ->filterByTruthyValue ($ expr ),
@@ -3494,7 +3500,7 @@ static function (): void {
3494
3500
}
3495
3501
} elseif ($ expr instanceof List_) {
3496
3502
// only in assign and foreach, processed elsewhere
3497
- return new ExpressionResult ($ scope , false , [], []);
3503
+ return new ExpressionResult ($ scope , false , false , [], []);
3498
3504
} elseif ($ expr instanceof New_) {
3499
3505
$ parametersAcceptor = null ;
3500
3506
$ constructorReflection = null ;
@@ -3646,7 +3652,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
3646
3652
$ nodeCallback ($ node , $ scope );
3647
3653
},
3648
3654
$ context ,
3649
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
3655
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
3650
3656
false ,
3651
3657
)->getScope ();
3652
3658
} elseif ($ expr instanceof Ternary) {
@@ -3691,6 +3697,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
3691
3697
return new ExpressionResult (
3692
3698
$ finalScope ,
3693
3699
$ ternaryCondResult ->hasYield (),
3700
+ false ,
3694
3701
$ throwPoints ,
3695
3702
$ impurePoints ,
3696
3703
static fn (): MutatingScope => $ finalScope ->filterByTruthyValue ($ expr ),
@@ -4020,11 +4027,11 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
4020
4027
return new ExpressionResult (
4021
4028
$ scope ,
4022
4029
$ hasYield ,
4030
+ $ isAlwaysTerminating ,
4023
4031
$ throwPoints ,
4024
4032
$ impurePoints ,
4025
4033
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
4026
4034
static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
4027
- $ isAlwaysTerminating ,
4028
4035
);
4029
4036
}
4030
4037
@@ -4741,7 +4748,7 @@ private function processArrowFunctionNode(
4741
4748
$ nodeCallback (new InArrowFunctionNode ($ arrowFunctionType , $ expr ), $ arrowFunctionScope );
4742
4749
$ exprResult = $ this ->processExprNode ($ stmt , $ expr ->expr , $ arrowFunctionScope , $ nodeCallback , ExpressionContext::createTopLevel ());
4743
4750
4744
- return new ExpressionResult ($ scope , false , $ exprResult ->getThrowPoints (), $ exprResult ->getImpurePoints ());
4751
+ return new ExpressionResult ($ scope , false , false , $ exprResult ->getThrowPoints (), $ exprResult ->getImpurePoints ());
4745
4752
}
4746
4753
4747
4754
/**
@@ -5263,7 +5270,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
5263
5270
$ nodeCallback ($ node , $ scope );
5264
5271
},
5265
5272
$ context ,
5266
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
5273
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
5267
5274
true ,
5268
5275
);
5269
5276
$ scope = $ result ->getScope ();
@@ -5296,7 +5303,7 @@ static function (Node $node, Scope $scope) use ($nodeCallback): void {
5296
5303
}
5297
5304
}
5298
5305
5299
- return new ExpressionResult ($ scope , $ hasYield , $ throwPoints , $ impurePoints , isAlwaysTerminating: $ isAlwaysTerminating );
5306
+ return new ExpressionResult ($ scope , $ hasYield , $ isAlwaysTerminating , $ throwPoints , $ impurePoints );
5300
5307
}
5301
5308
5302
5309
/**
@@ -5855,7 +5862,7 @@ static function (): void {
5855
5862
new GetOffsetValueTypeExpr ($ assignedExpr , $ dimExpr ),
5856
5863
$ nodeCallback ,
5857
5864
$ context ,
5858
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
5865
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
5859
5866
$ enterExpressionAssign ,
5860
5867
);
5861
5868
$ scope = $ result ->getScope ();
@@ -5941,7 +5948,7 @@ static function (): void {
5941
5948
}
5942
5949
}
5943
5950
5944
- return new ExpressionResult ($ scope , $ hasYield , $ throwPoints , $ impurePoints , isAlwaysTerminating: $ isAlwaysTerminating );
5951
+ return new ExpressionResult ($ scope , $ hasYield , $ isAlwaysTerminating , $ throwPoints , $ impurePoints );
5945
5952
}
5946
5953
5947
5954
/**
@@ -6277,7 +6284,7 @@ private function enterForeach(MutatingScope $scope, MutatingScope $originalScope
6277
6284
static function (): void {
6278
6285
},
6279
6286
ExpressionContext::createDeep (),
6280
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
6287
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
6281
6288
true ,
6282
6289
)->getScope ();
6283
6290
$ vars = $ this ->getAssignedVariables ($ stmt ->valueVar );
@@ -6295,7 +6302,7 @@ static function (): void {
6295
6302
static function (): void {
6296
6303
},
6297
6304
ExpressionContext::createDeep (),
6298
- static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , [], []),
6305
+ static fn (MutatingScope $ scope ): ExpressionResult => new ExpressionResult ($ scope , false , false , [], []),
6299
6306
true ,
6300
6307
)->getScope ();
6301
6308
$ vars = array_merge ($ vars , $ this ->getAssignedVariables ($ stmt ->keyVar ));
0 commit comments