-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Fix PSR-4 directory loader for abstract classes #48170
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
[Routing] Fix PSR-4 directory loader for abstract classes #48170
Conversation
derrabus
commented
Nov 9, 2022
Q | A |
---|---|
Branch? | 6.2 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | Fix #48168, Replaces #48169 |
License | MIT |
Doc PR | N/A |
Thank you @derrabus. |
shouldn't this also skip enums ? |
Enums don't cause an issue as far as I can tell. Shall I add one to the fixtures just in case? |
The fact that they don't have an issue is probably because the AnnotationClassLoader for the routing does not validate them (and so tries to load routes defined on them but it is unlikely to find some) |
Yes. Not sure what happens though if someone tried to add |
Probably a WTF error when trying to instantiate the controller (unless that part takes care of giving a better error message). However, I'm fine with failing for such case, as there is no valid reason for that (while a route in an abstract class might make sense in some cases where you have a child class belong loaded as well) |
… (derrabus) This PR was merged into the 6.2 branch. Discussion ---------- [Routing] Make sure enums don't confuse the PSR-4 loader | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | #48170 (comment) | License | MIT | Doc PR | N/A Commits ------- 6ae6af0 [Routing] Make sure enums don't confuse the PSR-4 loader