You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6354ce7
Browse filesBrowse the repository at this point in the historyBrowse files
Wrap NameResolver errors into ParserErrorsException so they are attributed to the file they come from
* `RichParser`, `SimpleParser` and `StubParser` now catch `PhpParser\Error` thrown
from the name-resolving `NodeTraverser` run and rethrow it as
`ParserErrorsException`, honouring the `@throws` contract of `PHPStan\Parser\Parser`.
* `parseFile()` then attaches the parsed file name, so `FileNodesFetcher` and
`ExportedNodeFetcher` degrade gracefully (symbol treated as not found) instead of
letting the exception escape into the file that merely looks the symbol up.
* Covers both errors `PhpParser\NameContext` can raise: the duplicate `use` alias
("Cannot use X as Y because the name is already in use", for `use`, `use function`,
`use const` and group uses) and "'\self' is an invalid class name".
* Also covers the analogous reach-another-file paths: class instantiation through the
source locators, and trait resolution (`Class X uses unknown trait Y.`).
* Parse errors of this kind reported for the analysed file itself now include the
" on line N" suffix, matching how syntax errors collected by php-parser are reported.
0 commit comments