Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

Wirone
Copy link
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
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