Commit 5626c00
committed
Fix define() before use statements breaking PHPDoc class resolution
- Removed !array_key_exists guard in FileTypeMapper::createPhpDocNodeMap() that prevented updating the name scope map entry after it was first set
- The first non-skipped statement (e.g. define()) would lock in an empty $uses array for that scope key, causing later PHPDocs to fail resolving class names from use statements
- New regression test in tests/PHPStan/Analyser/nsrt/bug-8950.php1 parent 106fc93 commit 5626c00
File tree
2 files changed
+20
-1
lines changed- src/Type
- tests/PHPStan/Analyser/nsrt
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| |||
| 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 | + | |
0 commit comments