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

Add support for allowing public readonly properties #1704

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tfrommen
Copy link
Contributor

In general, public properties are not great, and one should use method access where possible.

However, read-only properties are not that bad, which is why this PR adds support for allowing them via a new public property (ha-ha) on the ForbiddenPublicProperty sniff, in a backwards-compatible way.

@tfrommen
Copy link
Contributor Author

Hi @kukulich,

I was wondering if there is an interest in allowing for public readonly properties...?
If there is, I'm happy to get feedback on my approach. If not, I can easily use a custom sniff (maybe based on the Slevomat one, or not).

Thanks!

@kukulich
Copy link
Contributor

@tfrommen Yes, this PR will be accepted :) I hope I'll prepare new CS version around the release of PHP 8.4.

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.

2 participants