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

[Php56] Skip after infinite loop on AddDefaultValueForUndefinedVariableRector #3390

Merged
merged 13 commits into from
Feb 19, 2023

Conversation

samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

Oh, it seems can't be resolved by check first stmt as first stmt can be multiple condition, for example:

        echo 'test';

        while (true !== false) {
        }

that still added. I added more failing fixture for it e78c0ee

@samsonasik
Copy link
Member Author

I am not sure about this, the question is why create abvious infinite loop on early code in the first place :)

        while (true !== false) {
        }

        $a = [];

        if ($b = $yes) {
            $a[] = 'test';
        }

        return $a;

I am closing this for now.

@samsonasik samsonasik closed this Feb 19, 2023
@samsonasik samsonasik deleted the close-3388 branch February 19, 2023 08:52
@samsonasik samsonasik restored the close-3388 branch February 19, 2023 10:56
@samsonasik samsonasik reopened this Feb 19, 2023
@samsonasik
Copy link
Member Author

Re-open, @jackbentley it seems it can be resolved by check parent Node of Stmt is an Unreachable stmt on PHPStanNodeScopeResolver

@samsonasik
Copy link
Member Author

Finally, All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Member Author

@TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit c65e60f into main Feb 19, 2023
@samsonasik samsonasik deleted the close-3388 branch February 19, 2023 14: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
2 participants