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

[DeadCode] Skip return false pseudo type in union on RemoveUselessReturnTagRector #5172

Merged
merged 2 commits into from
Oct 15, 2023

Conversation

samsonasik
Copy link
Member

The following code is valid:

final class SkipReturnFalseOnUnionBool
{
    /**
     * @return false|\stdClass
     */
    function run(): bool|\stdClass
    {
        if (rand(0, 1)) {
            return false;
        }

        return new \stdClass();
    }
}

see https://phpstan.org/r/00534257-55dd-42d2-9104-c25aa5ca9872

@samsonasik
Copy link
Member Author

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

@samsonasik samsonasik merged commit e2ba601 into main Oct 15, 2023
41 checks passed
@samsonasik samsonasik deleted the pseudo-false branch October 15, 2023 02:03
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