Commit 5d66512
Fix dead catch false positive for dynamic class constant fetch
- Added implicit throw point for ClassConstFetch with dynamic name ($expr->name instanceof Expr)
- Dynamic class constant fetches like Foo::{$name} can throw \Error when the constant doesn't exist
- New regression test in tests/PHPStan/Rules/Exceptions/data/bug-13569.php
Closes phpstan/phpstan#135691 parent 1bbe9dc commit 5d66512
3 files changed
Lines changed: 25 additions & 0 deletions
File tree
- src/Analyser
- tests/PHPStan/Rules/Exceptions
- data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3877 | 3877 | | |
3878 | 3878 | | |
3879 | 3879 | | |
| 3880 | + | |
3880 | 3881 | | |
3881 | 3882 | | |
3882 | 3883 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
670 | 675 | | |
671 | 676 | | |
672 | 677 | | |
| |||
| 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