Skip to content

Allow default values for allow-private-mutation properties#2178

Merged
ondrejmirtes merged 1 commit intophpstan:1.10.xfrom
zonuexe:fix/readonly-allow-private-mutation-allows-default-value
Jan 16, 2023
Merged

Allow default values for allow-private-mutation properties#2178
ondrejmirtes merged 1 commit intophpstan:1.10.xfrom
zonuexe:fix/readonly-allow-private-mutation-allows-default-value

Conversation

@zonuexe
Copy link
Copy Markdown
Contributor

@zonuexe zonuexe commented Jan 12, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is no processing to get the PHPDoc of the parameter of the constructor promotion, so I ignored it with false.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is: https://phpstan.org/r/f22ccc98-94c2-4b7e-9d0f-152bdc575803

But beware - it doesn't mean there's a default value because the code isn't desugared like that.

That's why one is allowed and the other isn't: https://phpstan.org/r/c9757b83-4b83-4ee5-b517-e92e89b44126

@ondrejmirtes ondrejmirtes merged commit e39bbec into phpstan:1.10.x Jan 16, 2023
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you.

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.

Default value of allow-private-mutation property warns

2 participants