Skip to content

Conversation

sayuprc
Copy link
Contributor

@sayuprc sayuprc commented Jul 25, 2025

resolve phpstan/phpstan#13049

Fixed readonly for constructor promotions.


protected function getRule(): Rule
{
return new PropertyVarianceRule(new VarianceCheck());
Copy link
Member

Choose a reason for hiding this comment

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

The fix is great, but please put this into existing PropertyVarianceRuleTest instead of adding a new test case. Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!
I fixed in 4e32f77.

@sayuprc sayuprc requested a review from ondrejmirtes August 7, 2025 09:28
@ondrejmirtes ondrejmirtes merged commit 5a39902 into phpstan:2.1.x Aug 30, 2025
445 of 452 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@sayuprc sayuprc deleted the resolve-13049 branch August 30, 2025 16:31
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.

Promoted vs. regular property inconsistency with generics
2 participants