Commit b6073f0
Fix throw points not properly matched to catch clauses
- When a method has @throws with a supertype of the caught exception (e.g. @throws RuntimeException with catch PDOException), implicit throw points from other method calls were incorrectly excluded from the catch scope
- Phase 3 (implicit throw point matching) was skipped when explicit @throws matched even as "maybe", now it only skips when there's a definitive "yes" match
- Added regression test in tests/PHPStan/Rules/Variables/data/bug-9349.php
Closes phpstan/phpstan#93491 parent 66617b9 commit b6073f0
File tree
3 files changed
+78
-1
lines changed- src/Analyser
- tests/PHPStan/Rules/Variables
- data
3 files changed
+78
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1878 | 1878 | | |
1879 | 1879 | | |
1880 | 1880 | | |
| 1881 | + | |
1881 | 1882 | | |
1882 | 1883 | | |
1883 | 1884 | | |
| |||
1895 | 1896 | | |
1896 | 1897 | | |
1897 | 1898 | | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
1898 | 1902 | | |
1899 | 1903 | | |
1900 | 1904 | | |
1901 | 1905 | | |
1902 | 1906 | | |
1903 | 1907 | | |
1904 | 1908 | | |
1905 | | - | |
| 1909 | + | |
1906 | 1910 | | |
1907 | 1911 | | |
1908 | 1912 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1403 | 1403 | | |
1404 | 1404 | | |
1405 | 1405 | | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
1406 | 1421 | | |
1407 | 1422 | | |
1408 | 1423 | | |
| |||
| 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 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments