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

property is assigned outside of the constructor reports twice with bleeding edge enabled #7648

Closed
fluffycondor opened this issue Jul 18, 2022 · 2 comments · Fixed by phpstan/phpstan-src#1521

Comments

@fluffycondor
Copy link
Contributor

Bug report

The same issue is reported twice, one time for /** @immutable */ annotation and one more for readonly keyword.

Code snippet that reproduces the problem

https://phpstan.org/r/38844f63-55f7-43bf-bf2a-71942b8fd221

Expected output

The issue should be reported only once.

@ondrejmirtes
Copy link
Member

These rules are independent but possibly we could write a condition in the ByPhpDoc rules to not report the things if it's also readonly natively. /cc @herndlm

Also, arguably, there's no value in annotating the things with both the native and the PHPDoc way :)

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants