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

[TypeDeclaration] Remove only void type on ReturnedNodesReturnTypeInfererTypeInferer #6340

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

samsonasik
Copy link
Member

The service verify Return_ statement expr, which utilize collection of local return nodes via:

$localReturnNodes = $this->betterNodeFinder->findReturnsScoped($functionLike);

which if it found a Yield_, it stopped and returns [] array, which it is not a void type.

On the other hand, for Void addition usage, the Yield_ already checked on SilentVoidResolver which verify if it always a Void return as no Return_ nor Yield on AddVoidReturnTypeWhereNoReturnRector rule.

This ensure consistency of usage and verify VoidType only return.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit a11fc61 into main Oct 1, 2024
36 checks passed
@samsonasik samsonasik deleted the remove-only-void branch October 1, 2024 09:53
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.

1 participant