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

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

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 2 commits intosymfony:6.1fromnicolas-grekas:eh-final-props
Feb 10, 2022

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedFeb 8, 2022
edited
Loading

QA
Branch?6.1
Bug fix?no
New feature?yes
Deprecations?yes
TicketsFix#43600
LicenseMIT
Doc PR-

This PR makes DebugClassLoader trigger a deprecation when a property in a child class is redefined while the same property is@final on 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 theSymfony\ 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.

Copy link
Member

@derrabusderrabus left a 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.

Copy link
Contributor

@fancywebfancyweb left a 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 theSymfony\ 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.

@nicolas-grekas
Copy link
MemberAuthor

test with two classes in the same namespace
test with a class outside the Symfony\ namespace
test that the behavior is different when the property is typed

PR welcome on my fork :)

test that the behavior is different for a static property

I removed that check

@nicolas-grekas
Copy link
MemberAuthor

This PR will be green after#45371 is merged. Review welcome.

@nicolas-grekasnicolas-grekas added this to the6.1 milestoneFeb 9, 2022
@carsonbotcarsonbot changed the title[ErrorHandler] trigger deprecations for@final propertiestrigger deprecations for@final propertiesFeb 9, 2022
@carsonbotcarsonbot changed the titletrigger deprecations for@final properties[ErrorHandler] trigger deprecations for@final propertiesFeb 9, 2022
@nicolas-grekas
Copy link
MemberAuthor

Thank you@fancyweb.

@nicolas-grekasnicolas-grekas merged commit6e3d5c1 intosymfony:6.1Feb 10, 2022
@nicolas-grekasnicolas-grekas deleted the eh-final-props branchFebruary 10, 2022 10:29
@fabpotfabpot mentioned this pull requestApr 15, 2022
nicolas-grekas added a commit that referenced this pull requestJul 28, 2023
…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#45360Follows#51068 and#51067Commits-------7ea2461 Add types to public and protected properties
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus approved these changes

@ycerutoycerutoyceruto approved these changes

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

+1 more reviewer

@fancywebfancywebfancyweb approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.1

Development

Successfully merging this pull request may close these issues.

Using typed properties on public/protected properties

5 participants

@nicolas-grekas@derrabus@yceruto@fancyweb@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp