-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Extend old Annotations from new Attributes #52544
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
We should do the same for all classes patched in #52294 |
Yes, but not this weekend :) |
Turns out I had some time to spare, so done. I had to remove some |
@@ -20,7 +20,7 @@ | |||
* @author Kévin Dunglas <dunglas@gmail.com> | |||
*/ | |||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] | |||
final class Ignore |
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.
Please add the @final
annotation so that we don't support BC for child classes (as they might not work when reading attributes anyway)
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.
Fair enough, should be noted that many other attributes (ie. in DependencyInjection) are also not marked final. Out of scope for this PR to look into that.
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.
For some of them, it is intended as we explicit added support for extending them.
Thank you @curry684. |
If the base class is missing PHPStan fails to recognize the aliasing correctly.
Due to a shortcoming in PHPStan it does not pick up the previous aliasing correctly (ref. https://phpstan.org/r/2c7a9166-e8e1-42e5-8448-54c7d814e7d9).
This will cause projects to start failing their static analysis when they upgrade to 6.4. Explicitly extending the new attribute in the Attribute namespace has no runtime impact and shuts up PHPStan.