-
-
Notifications
You must be signed in to change notification settings - Fork 75
Replace PHP-Scoper name resolver by the PHP-Parser one (Part 1) #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@marekdedic I believe quite a few cases broken related to not adding prefixes. I'm trying to look at it but can't find a solution at the moment. If you have any lead it would be very welcomed |
Hi, Any good place where to start? E. g. a test that fails because of prefixes... |
I'm really not sure... This PR is kinda of a start from #400 already :P i couldn't check in much more details after scoping this down a bit |
@marekdedic I think I have a good lead, I hope I will have something out very soon |
There is more changes & cleanup I wish to do but this PR is the first step and doing the strict minimum: register the PHP-Parser name resolver visitor and fixing the tests |
Hi, $ bin/box compile
Fatal error: Uncaught Error: Call to undefined method Humbug\PhpScoper\Configuration::load() in /home/user/php-scoper/vendor/humbug/box/src/Configuration/Configuration.php:2700 Looking at the file in question, it seems like an issue with box - it tries to call a non-existent method. I can't see how this is related to any of the changes you made though... |
No the e2e tests failure are expected: it's due to a BC break of the config |
Ok, ok, so is there any issue with the "simplified" prefixes then? |
Not that I can see unless you see any offender there in the change of the tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I am still a bit confused by whitelisting, though...
I'll come up with a rename to remove the confusion hopefully |
This is a continuation of #400 but taking an easier starting path. I had some misunderstanding about PHP-Parser's name resolver, and from the doc (see https://github.com/nikic/PHP-Parser/blob/master/doc/component/Name_resolution.markdown#name-resolution) it actually replaces all name nodes by its fully qualified form whenever possible. Whilst it's possible to toggle off the replace, I believe this will lead to simpler cases in PHP-Scoper so we might as well go for it.
However it currently breaks all the tests so need to fix that first