Skip to content

Add a test covering a hooked property in a readonly class #3809

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

jakubtobiasz
Copy link
Contributor

@jakubtobiasz jakubtobiasz commented Feb 5, 2025

$node->isReadOnly() returns true when a property lives inside a readonly class, so I've added only a simple test to existing test suite :).

Fulfills Readonly classes cannot have hooked properties (ref: phpstan/phpstan#12336)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@jakubtobiasz jakubtobiasz force-pushed the readonly-classes-cannot-have-hooked-properties branch from 8bf7250 to 9a0ba16 Compare February 5, 2025 19:27
@ondrejmirtes ondrejmirtes merged commit d0b4a27 into phpstan:2.1.x Feb 6, 2025
267 checks passed
@ondrejmirtes
Copy link
Member

Thank you very much! BTW each item in the linked issue does not have to be a separate PR, you can do multiple items at once if they are related :)

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.

None yet

2 participants