-
-
Notifications
You must be signed in to change notification settings - Fork 76
Use BetterReflection for global classes #117
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
94f8c22 to
e5c571f
Compare
8826fbb to
d735b41
Compare
theofidry
left a comment
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.
I think I went a bit too far in that PR as a few behavioural changes could have been done in other PRs to make it simpler.
However as it stands now too many tests would require to be updated so the overhead would be quite significant.
I think it's better to cleanup this PR and continue the remaining work in other PRs but not worth to rework this PR to simplify it by breaking it down in several PRs which would have a lot of conflicts.
TODO-roave
Outdated
| @@ -0,0 +1,112 @@ | |||
| // vendor/roave/better-reflection/src/SourceLocator/Ast/Locator.php | |||
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.
TODO: this should be a patch for roave/better-reflection
tests/Scoper/PhpScoperTest.php
Outdated
| $whitelister = function (string $className) { | ||
| return 'AppKernel' === $className; | ||
| }; | ||
| $nonInternalReflectionProphecy = $this->prophesize(ReflectionClass::class); |
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.
no longer necessary
| if (null === $namespace->name && $this->hasWhitelistedNode([$namespace])) { | ||
| return true; | ||
| } | ||
| // if (null === $namespace->name && $this->hasWhitelistedNode([$namespace])) { |
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.
can be simplified
| || AppendParentNode::hasParent($node) | ||
| ) ? $node : $this->wrapNamespace($node); | ||
| } | ||
| // |
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.
can be simplified
.TODO
Outdated
| @@ -0,0 +1,17 @@ | |||
| Right now whitelisted class works as follow: | |||
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.
Should be transformed into several issues rather than this file
5577270 to
02ef70e
Compare
|
The e2e tests are not passing due to #152 |
Instead of not touching the global classes at all and prefix them only when explicitly specified, we can prefix them if they are not internal. We could then get rid of the global whitelist and allow the whitelist for classes belonging to the global namespace.
Current status: did a replacement and updating the tests; need more refactoring and checking the list above