Commit d4d3271
committed
Handle parse error in File::getMethodProperties()
While investigating the cause of a PHP Fatal error while processing some input
in the `PSR12.Functions.ReturnTypeDeclaration` sniff, I noticed that the
`File::getMethodProperties()` method did not return sensible values in for some
parse errors. The input file in question was
`src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.2.inc`,
which contains an intentional parse error. The `File::getMethodProperties()`
method claimed that the return type of the `test` function was `<< HEAD`, which
is nonsense.
The change in this commit safeguards from such parse errors and resolves the
issue that was being encountered downstream in the sniff.1 parent e1fcbea commit d4d3271
3 files changed
Lines changed: 38 additions & 1 deletion
File tree
- src/Files
- tests/Core/Files/File
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1781 | 1781 | | |
1782 | 1782 | | |
1783 | 1783 | | |
| 1784 | + | |
| 1785 | + | |
1784 | 1786 | | |
1785 | 1787 | | |
1786 | 1788 | | |
| |||
1800 | 1802 | | |
1801 | 1803 | | |
1802 | 1804 | | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
1803 | 1810 | | |
1804 | 1811 | | |
| 1812 | + | |
1805 | 1813 | | |
1806 | 1814 | | |
1807 | | - | |
| 1815 | + | |
1808 | 1816 | | |
1809 | 1817 | | |
1810 | 1818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
224 | 228 | | |
225 | 229 | | |
226 | 230 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1450 | 1450 | | |
1451 | 1451 | | |
1452 | 1452 | | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
1453 | 1478 | | |
1454 | 1479 | | |
1455 | 1480 | | |
| |||
0 commit comments