Skip to content

InlineConstructorDefaultToPropertyRector Readonly Class#5085

Merged
TomasVotruba merged 2 commits intorectorphp:mainfrom
beschoenen:main
Sep 27, 2023
Merged

InlineConstructorDefaultToPropertyRector Readonly Class#5085
TomasVotruba merged 2 commits intorectorphp:mainfrom
beschoenen:main

Conversation

@beschoenen
Copy link
Copy Markdown
Contributor

PHP Parser does not mark properties as readonly when the class itself is readonly. Therefor we also need to check the class if it's readonly.

This feels like a bug in PHP-Parser though, so I've also opened an issue there. nikic/PHP-Parser#949

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Sep 27, 2023

could you add a unit test for the case you are talking about?

@beschoenen
Copy link
Copy Markdown
Contributor Author

@staabm Added

@TomasVotruba
Copy link
Copy Markdown
Member

TomasVotruba commented Sep 27, 2023

Looks good 👍 Thank you

@TomasVotruba TomasVotruba merged commit 5fb68b4 into rectorphp:main Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants