Skip to content

Use FunctionLike contract instead of union of function-like concrete implementations#4241

Merged
TomasVotruba merged 1 commit intorectorphp:mainfrom
Wirone:codito/improve-ParamRenameFactory
Jun 16, 2023
Merged

Use FunctionLike contract instead of union of function-like concrete implementations#4241
TomasVotruba merged 1 commit intorectorphp:mainfrom
Wirone:codito/improve-ParamRenameFactory

Conversation

@Wirone
Copy link
Copy Markdown
Contributor

@Wirone Wirone commented Jun 16, 2023

It does not make sense to use ClassMethod | Function_ | Closure | ArrowFunction because when consuming such contract it requires using instanceof anyway (same as with FunctionLike interface). Also, it forces custom rectors to use union too in the signatures, but if PHP 7.4 is used, there's no way to achieve it with native types and phpDoc has to be used instead.

@Wirone Wirone requested a review from TomasVotruba as a code owner June 16, 2023 12:36
@TomasVotruba
Copy link
Copy Markdown
Member

Thanks 👍

@TomasVotruba TomasVotruba merged commit a8339a3 into rectorphp:main Jun 16, 2023
@Wirone Wirone deleted the codito/improve-ParamRenameFactory branch June 16, 2023 14:05
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.

2 participants