Commit 654734a
Allow ClassConstFetch on new to be remembered, add tests for all expression types
Class constants are class-level, not instance-level, so narrowed types
from (new Foo())::MY_CONST should still be remembered. Also fix a type
error where $expr->class could be a Name (not Expr) for static calls.
Added tests covering: method calls, nullsafe method calls, property
fetches, nullsafe property fetches, array dim fetches, static calls,
static property fetches, class const fetches, and chained expressions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent dbdb449 commit 654734a
File tree
2 files changed
+8
-1
lines changed- src/Analyser
- tests/PHPStan/Analyser/nsrt
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1002 | 1002 | | |
1003 | 1003 | | |
1004 | 1004 | | |
1005 | | - | |
1006 | 1005 | | |
1007 | 1006 | | |
1008 | 1007 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
0 commit comments