Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@derrabus
Copy link
Member

QA
Branch?6.2
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#48168, Replaces#48169
LicenseMIT
Doc PRN/A

@carsonbotcarsonbot added this to the6.2 milestoneNov 9, 2022
MatTheCat added a commit to MatTheCat/symfony that referenced this pull requestNov 9, 2022
@nicolas-grekas
Copy link
Member

Thank you@derrabus.

@nicolas-grekasnicolas-grekas merged commit91b2bca intosymfony:6.2Nov 9, 2022
@stof
Copy link
Member

stof commentedNov 9, 2022

shouldn't this also skip enums ?

@derrabusderrabus deleted the bugfix/psr4-routing-abstract branchNovember 9, 2022 13:21
@derrabus
Copy link
MemberAuthor

Enums don't cause an issue as far as I can tell. Shall I add one to the fixtures just in case?

@derrabus
Copy link
MemberAuthor

#48177

@stof
Copy link
Member

stof commentedNov 9, 2022

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)

@derrabus
Copy link
MemberAuthor

Yes. Not sure what happens though if someone tried to addRoute attributes to a enum method. 🙈

@stof
Copy link
Member

stof commentedNov 10, 2022
edited
Loading

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)

fabpot added a commit that referenced this pull requestNov 11, 2022
… (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/ACommits-------6ae6af0 [Routing] Make sure enums don't confuse the PSR-4 loader
@fabpotfabpot mentioned this pull requestNov 19, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

[Routing] Psr4DirectoryLoader issue with abstract classes

5 participants

@derrabus@nicolas-grekas@stof@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp