Skip to content
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

Hooked properties cannot be both final and private #3830

Open
wants to merge 2 commits into
base: 2.1.x
Choose a base branch
from

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Feb 16, 2025

@staabm staabm marked this pull request as ready for review February 16, 2025 15:52
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even non-hooked property cannot be final&private: https://3v4l.org/fAXFZ

Also please check the same error for methods and constants (it might already be implemented, not sure)

Also, please add an error that would report final properties on PHP < 8.4.

Also, please add error for final properties in interfaces.

Also, please add error for final hooks in abstract properties (in both class and interface): https://3v4l.org/hSO0C#v8.4.4

Also, abstract + final property together is not allowed.

@staabm
Copy link
Contributor Author

staabm commented Feb 19, 2025

memo to me: more cases to consider

additional: follow discussion in php/php-src#17861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants