Commit b0fac99
Resolve method reflection for $var::method() static calls
- When $expr->class is an Expr (variable), resolve method reflection and
parameters acceptor using getObjectTypeOrClassStringObjectType() so
by-reference parameters and other argument analysis work correctly
- Guard $this invalidation and constructor property initialization blocks
with $expr->class instanceof Name to prevent $other::__construct()
from incorrectly affecting $this
- New regression test in tests/PHPStan/Analyser/nsrt/bug-5020.php1 parent 8717c5d commit b0fac99
File tree
2 files changed
+73
-0
lines changed- src/Analyser
- tests/PHPStan/Analyser/nsrt
2 files changed
+73
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3381 | 3381 | | |
3382 | 3382 | | |
3383 | 3383 | | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
3384 | 3403 | | |
3385 | 3404 | | |
3386 | 3405 | | |
| |||
3410 | 3429 | | |
3411 | 3430 | | |
3412 | 3431 | | |
| 3432 | + | |
3413 | 3433 | | |
3414 | 3434 | | |
3415 | 3435 | | |
| |||
3425 | 3445 | | |
3426 | 3446 | | |
3427 | 3447 | | |
| 3448 | + | |
3428 | 3449 | | |
3429 | 3450 | | |
3430 | 3451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments