-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[ErrorHandler] trigger deprecations for @final properties
#45360
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
cf4b347 to
5d0282f
Compare
derrabus
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.
Looks good. Maybe we should document a way forward.
5d0282f to
92b917e
Compare
92b917e to
3ec3d6b
Compare
fancyweb
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'm approving the code but some tests are missing for me:
- test with two classes in the same namespace
- test with a class outside the
Symfony\namespace - test that the behavior is different for a static property
- test that the behavior is different when the property is typed
I can help you if you want.
3ec3d6b to
d535ced
Compare
PR welcome on my fork :)
I removed that check |
d535ced to
0c4a7c7
Compare
|
This PR will be green after #45371 is merged. Review welcome. |
0c4a7c7 to
061943a
Compare
@final properties@final properties
@final properties@final properties
c00cd1b to
eada4c0
Compare
|
Thank you @fancyweb. |
…grekas) This PR was merged into the 7.0 branch. Discussion ---------- Add types to public and protected properties | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - :hot_face: Allowed by #45360 Follows #51068 and #51067 Commits ------- 7ea2461 Add types to public and protected properties
This PR makes DebugClassLoader trigger a deprecation when a property in a child class is redefined while the same property is
@finalon the parent class (the deprecation is silenced when both classes live in the exact same namespace or when the child property is deprecated.)It also makes all properties in the
Symfony\namespace implicitly@final, unless they are typed. The goal here is to be able to add types to all properties in 7.0, thus fixing #43600.