Skip to content

[TypeDeclaration] Do not add default value when assigned in __construct() on TypedPropertyFromStrictGetterMethodReturnTypeRector#4886

Merged
samsonasik merged 3 commits intomainfrom
don-tad
Aug 31, 2023
Merged

[TypeDeclaration] Do not add default value when assigned in __construct() on TypedPropertyFromStrictGetterMethodReturnTypeRector#4886
samsonasik merged 3 commits intomainfrom
don-tad

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@TomasVotruba continue of PR:

when initialized in __construct(), default value should not be added.

…ct() on TypedPropertyFromStrictGetterMethodReturnTypeRector
@samsonasik
Copy link
Copy Markdown
Member Author

Fixed 🎉

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 56c84ba into main Aug 31, 2023
@samsonasik samsonasik deleted the don-tad branch August 31, 2023 11:36
@TomasVotruba
Copy link
Copy Markdown
Member

Looks good 👍

I think the getter rule should skip these cases, as the constructor defines a property type here. What do you think?

@samsonasik
Copy link
Copy Markdown
Member Author

For direct single rule usage, the type still make sense, just don't add default value as always replaced early on __construct.

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.

2 participants