@@ -2373,7 +2373,7 @@ public function pushInFunctionCall($reflection): self
2373
2373
$ stack = $ this ->inFunctionCallsStack ;
2374
2374
$ stack [] = $ reflection ;
2375
2375
2376
- return $ this ->scopeFactory ->create (
2376
+ $ scope = $ this ->scopeFactory ->create (
2377
2377
$ this ->context ,
2378
2378
$ this ->isDeclareStrictTypes (),
2379
2379
$ this ->constantTypes ,
@@ -2392,14 +2392,19 @@ public function pushInFunctionCall($reflection): self
2392
2392
$ this ->afterExtractCall ,
2393
2393
$ this ->parentScope ,
2394
2394
);
2395
+ $ scope ->resolvedTypes = $ this ->resolvedTypes ;
2396
+ $ scope ->truthyScopes = $ this ->truthyScopes ;
2397
+ $ scope ->falseyScopes = $ this ->falseyScopes ;
2398
+
2399
+ return $ scope ;
2395
2400
}
2396
2401
2397
2402
public function popInFunctionCall (): self
2398
2403
{
2399
2404
$ stack = $ this ->inFunctionCallsStack ;
2400
2405
array_pop ($ stack );
2401
2406
2402
- return $ this ->scopeFactory ->create (
2407
+ $ scope = $ this ->scopeFactory ->create (
2403
2408
$ this ->context ,
2404
2409
$ this ->isDeclareStrictTypes (),
2405
2410
$ this ->constantTypes ,
@@ -2418,6 +2423,11 @@ public function popInFunctionCall(): self
2418
2423
$ this ->afterExtractCall ,
2419
2424
$ this ->parentScope ,
2420
2425
);
2426
+ $ scope ->resolvedTypes = $ this ->resolvedTypes ;
2427
+ $ scope ->truthyScopes = $ this ->truthyScopes ;
2428
+ $ scope ->falseyScopes = $ this ->falseyScopes ;
2429
+
2430
+ return $ scope ;
2421
2431
}
2422
2432
2423
2433
/** @api */
@@ -3165,7 +3175,7 @@ public function enterExpressionAssign(Expr $expr): self
3165
3175
$ currentlyAssignedExpressions = $ this ->currentlyAssignedExpressions ;
3166
3176
$ currentlyAssignedExpressions [$ exprString ] = true ;
3167
3177
3168
- return $ this ->scopeFactory ->create (
3178
+ $ scope = $ this ->scopeFactory ->create (
3169
3179
$ this ->context ,
3170
3180
$ this ->isDeclareStrictTypes (),
3171
3181
$ this ->constantTypes ,
@@ -3184,6 +3194,11 @@ public function enterExpressionAssign(Expr $expr): self
3184
3194
$ this ->afterExtractCall ,
3185
3195
$ this ->parentScope ,
3186
3196
);
3197
+ $ scope ->resolvedTypes = $ this ->resolvedTypes ;
3198
+ $ scope ->truthyScopes = $ this ->truthyScopes ;
3199
+ $ scope ->falseyScopes = $ this ->falseyScopes ;
3200
+
3201
+ return $ scope ;
3187
3202
}
3188
3203
3189
3204
public function exitExpressionAssign (Expr $ expr ): self
@@ -3192,7 +3207,7 @@ public function exitExpressionAssign(Expr $expr): self
3192
3207
$ currentlyAssignedExpressions = $ this ->currentlyAssignedExpressions ;
3193
3208
unset($ currentlyAssignedExpressions [$ exprString ]);
3194
3209
3195
- return $ this ->scopeFactory ->create (
3210
+ $ scope = $ this ->scopeFactory ->create (
3196
3211
$ this ->context ,
3197
3212
$ this ->isDeclareStrictTypes (),
3198
3213
$ this ->constantTypes ,
@@ -3211,6 +3226,11 @@ public function exitExpressionAssign(Expr $expr): self
3211
3226
$ this ->afterExtractCall ,
3212
3227
$ this ->parentScope ,
3213
3228
);
3229
+ $ scope ->resolvedTypes = $ this ->resolvedTypes ;
3230
+ $ scope ->truthyScopes = $ this ->truthyScopes ;
3231
+ $ scope ->falseyScopes = $ this ->falseyScopes ;
3232
+
3233
+ return $ scope ;
3214
3234
}
3215
3235
3216
3236
/** @api */
@@ -3226,7 +3246,7 @@ public function setAllowedUndefinedExpression(Expr $expr): self
3226
3246
$ currentlyAllowedUndefinedExpressions = $ this ->currentlyAllowedUndefinedExpressions ;
3227
3247
$ currentlyAllowedUndefinedExpressions [$ exprString ] = true ;
3228
3248
3229
- return $ this ->scopeFactory ->create (
3249
+ $ scope = $ this ->scopeFactory ->create (
3230
3250
$ this ->context ,
3231
3251
$ this ->isDeclareStrictTypes (),
3232
3252
$ this ->constantTypes ,
@@ -3245,6 +3265,11 @@ public function setAllowedUndefinedExpression(Expr $expr): self
3245
3265
$ this ->afterExtractCall ,
3246
3266
$ this ->parentScope ,
3247
3267
);
3268
+ $ scope ->resolvedTypes = $ this ->resolvedTypes ;
3269
+ $ scope ->truthyScopes = $ this ->truthyScopes ;
3270
+ $ scope ->falseyScopes = $ this ->falseyScopes ;
3271
+
3272
+ return $ scope ;
3248
3273
}
3249
3274
3250
3275
public function unsetAllowedUndefinedExpression (Expr $ expr ): self
@@ -3253,7 +3278,7 @@ public function unsetAllowedUndefinedExpression(Expr $expr): self
3253
3278
$ currentlyAllowedUndefinedExpressions = $ this ->currentlyAllowedUndefinedExpressions ;
3254
3279
unset($ currentlyAllowedUndefinedExpressions [$ exprString ]);
3255
3280
3256
- return $ this ->scopeFactory ->create (
3281
+ $ scope = $ this ->scopeFactory ->create (
3257
3282
$ this ->context ,
3258
3283
$ this ->isDeclareStrictTypes (),
3259
3284
$ this ->constantTypes ,
@@ -3272,6 +3297,11 @@ public function unsetAllowedUndefinedExpression(Expr $expr): self
3272
3297
$ this ->afterExtractCall ,
3273
3298
$ this ->parentScope ,
3274
3299
);
3300
+ $ scope ->resolvedTypes = $ this ->resolvedTypes ;
3301
+ $ scope ->truthyScopes = $ this ->truthyScopes ;
3302
+ $ scope ->falseyScopes = $ this ->falseyScopes ;
3303
+
3304
+ return $ scope ;
3275
3305
}
3276
3306
3277
3307
/** @api */
0 commit comments