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 property can be not set in if-else condition, and PHPStan yields no error #7649

Closed
fluffycondor opened this issue Jul 18, 2022 · 3 comments

Comments

@fluffycondor
Copy link
Contributor

fluffycondor commented Jul 18, 2022

Bug report

Readonly property can be not set in if-else condition, and PHPStan yields no error.

Code snippet that reproduces the problem

https://phpstan.org/r/9d088cab-7c46-4d83-a75b-739900979c5b

Expected output

This snippet should yield a "Readonly property not set in the constructor" issue.

@herndlm
Copy link
Contributor

herndlm commented Jul 18, 2022

duplicate of #6402, this seems to be trickier unfortunately

@fluffycondor fluffycondor changed the title False-positive Readonly property is already assigned in if-else condition Readonly property can be not set in if-else condition, and PHPStan yields no error Jul 18, 2022
@fluffycondor
Copy link
Contributor Author

Oh thanks. I removed the duplicated part of the issue.

@github-actions
Copy link

github-actions bot commented Aug 6, 2023

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 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants