Skip to content

[TypeDeclaration] Remove AddClosureReturnTypeRector#4637

Merged
TomasVotruba merged 2 commits intomainfrom
remove-add-closure
Aug 3, 2023
Merged

[TypeDeclaration] Remove AddClosureReturnTypeRector#4637
TomasVotruba merged 2 commits intomainfrom
remove-add-closure

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik commented Aug 3, 2023

@TomasVotruba @staabm the AddClosureReturnTypeRector use docblock from method caller as return type, which invalid.

I think this rule can be removed and use more specific return type rules instead.

see https://getrector.com/demo/d2f40f82-855f-4414-adb5-7ae99cfc7ce0

@samsonasik
Copy link
Copy Markdown
Member Author

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Aug 3, 2023

don't we have a ReturnType*FromStrict rule which works on the same cases but with a native return type?

if so, maybe some of the test-cases can be moved into that rule

@samsonasik
Copy link
Copy Markdown
Member Author

ReturnTypeFromStrictTypedCallRector already cover that, here the test:

@samsonasik
Copy link
Copy Markdown
Member Author

@staabm I added test case by docblock for ReturnTypeFromStrictTypedCallRector 7bf8ea1

@TomasVotruba
Copy link
Copy Markdown
Member

Awesome cleanup 🎉 👍

@TomasVotruba TomasVotruba merged commit 5ee441f into main Aug 3, 2023
@TomasVotruba TomasVotruba deleted the remove-add-closure branch August 3, 2023 16:34
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