Closed mortenson closed 2 years ago
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
From reviewing other GitHub issues, it looks like PHPParser was updated to v4 without moving to use Node\Identifier
which is the root cause of the issue. See https://github.com/phpstan/phpstan/issues/859 for more details and https://github.com/phpstan/phpstan/pull/1008/files for an example PR.
@fieryprophet if you'd like, I can try to go through the codebase and fix more issues. The changes in this PR were done based on manual testing.
Just started using this project and found that traits and closures were unusable.
For traits, aliases, and interfaces, I found that the name of the trait was always passed to the visitor as
Node\Identifier
, notstring
, but included both for BC. Maybe a change in PHPParser?For closures, the
$name instanceof
checks incheckFunc
could never be reached because of the function's type hint.Sorry to lump them in one PR but that's how I committed it in my fork. I've added test coverage for both cases as well. Thanks!