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

@readonly above class #11775

Open
mvorisek opened this issue Oct 1, 2024 · 0 comments · May be fixed by phpstan/phpstan-src#3523
Open

@readonly above class #11775

mvorisek opened this issue Oct 1, 2024 · 0 comments · May be fixed by phpstan/phpstan-src#3523

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Oct 1, 2024

Feature request

There is readonly native class modifier. However it seems unsupported as phpdoc above class.

repro: https://phpstan.org/r/874645f0-1413-4f4c-a5ec-ab69a5958127

The repro shows @immutable phpdoc tag above works, but @readonly does not.

I belive @readonly should be supported exactly the same as @immutable.

If, for some reasons, this is not wanted because of having two phpdoc tags for the same purpose, phpstan should emit an error when @readonly above class is used, otherwise user can very easy be misleaded beliving phpstan is monitoring the class for readonly usage.

Did PHPStan help you today? Did it make you happy in any way?

No response

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

Successfully merging a pull request may close this issue.

2 participants