-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Remove @final
annotation from Route
attribute
#53606
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] Remove @final
annotation from Route
attribute
#53606
Conversation
Hey! Thanks for your PR. You are targeting branch "7.1" but it seems your PR description refers to branch "7.1 for features". Cheers! Carsonbot |
src/Symfony/Component/Routing/Tests/Loader/AttributeClassLoaderTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Routing/Tests/Fixtures/AttributeFixtures/ExtendedRoute.php
Outdated
Show resolved
Hide resolved
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, AttributeClassLoader
already uses \ReflectionAttribute::IS_INSTANCEOF
so I'm not even sure why the class is final.
Just CS changes and good to merge on my side.
@nicolas-grekas Given you're not sure about the reason for this class to be final, would it be an option to target the 6.4 branch? (and see it as a bug fix instead of a new feature) Due to the nature of our project, we prefer not to update to Symfony 7 yet, but we would like to convert our annotations to attributes to remove a lot of lines from our deprecation logs. I can imagine this is the case for more developers. |
5f493e8
to
4aa6904
Compare
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 was wondering the same thing a few days ago when I wanted to create a #[Post]
route attribute instead of using #[Route(methods: 'POST')]
.
src/Symfony/Component/Routing/Tests/Fixtures/AttributeFixtures/ExtendedRoute.php
Show resolved
Hide resolved
This was done in #52544 and I think this was overzealous yes, let's target 6.4 for this one. |
To be able to create a custom attribute containing application or section level defaults, the final annotation is removed from the Route attribute. Fixes symfony#53467
4aa6904
to
c08a908
Compare
Thank you @tjveldhuizen. |
I totally agree it was not intended. My comment requesting to add |
Thanks for the merge! I have not investigated, but are there more locations where it would be better to remove the |
To be able to create a custom attribute containing application or section level defaults, the final annotation is removed from the Route attribute.
Fixes #53467
Removing the
@final
annotations makes it possible to create custom Route annotations containing pre set properties relevant for your application. Examples are a host name, defaults, requirements.