Skip to content

[TypeDeclaration] Introducing ClosureReturnTypeRector to handle closure types separately#6106

Merged
TomasVotruba merged 8 commits intomainfrom
tv-single-closure
Jul 3, 2024
Merged

[TypeDeclaration] Introducing ClosureReturnTypeRector to handle closure types separately#6106
TomasVotruba merged 8 commits intomainfrom
tv-single-closure

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jul 3, 2024

Closes rectorphp/rector#8678

At the moment we have single AddArrowFunctionReturnTypeRector to handle these cases. I think it makes sense, as in the wild there is hundreds of methods/functions, but much less callbacks/arrow functions. So it's easier to review these cases without granulation.

This rule ClosureReturnTypeRector will handle all closure cases. It will keep ClassMethod and Fuction_ rules separated and granulated, and easier to add types to closures in a separete Rector run :)

@TomasVotruba TomasVotruba changed the title tv single closure [TypeDeclaratoin] Introducing ClosureReturnTypeRector to handle closure types separately Jul 3, 2024
@TomasVotruba TomasVotruba changed the title [TypeDeclaratoin] Introducing ClosureReturnTypeRector to handle closure types separately [TypeDeclaration] Introducing ClosureReturnTypeRector to handle closure types separately Jul 3, 2024
@TomasVotruba TomasVotruba requested a review from samsonasik July 3, 2024 09:45
@TomasVotruba
Copy link
Copy Markdown
Member Author

Let's 🚢 it 👍

@TomasVotruba TomasVotruba merged commit fd5f15c into main Jul 3, 2024
@TomasVotruba TomasVotruba deleted the tv-single-closure branch July 3, 2024 10:44
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.

[DX] Allow more granulated return type completion, to separate from closures and makes easier to review

2 participants