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

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

Merged
merged 1 commit into from
Jan 16, 2023
Merged

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

merged 1 commit into from
Jan 16, 2023

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Jan 12, 2023

@@ -534,6 +534,7 @@ private function processStmtNode(
false,
$scope->isInTrait(),
$scope->getClassReflection()->isReadOnly(),
false
Copy link
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
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
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
2 participants