Skip to content

Add failing test fixture for AddDefaultValueForUndefinedVariableRector with infinite loop#3388

Closed
jackbentley wants to merge 1 commit intorectorphp:mainfrom
jackbentley:patch-1
Closed

Add failing test fixture for AddDefaultValueForUndefinedVariableRector with infinite loop#3388
jackbentley wants to merge 1 commit intorectorphp:mainfrom
jackbentley:patch-1

Conversation

@jackbentley
Copy link
Copy Markdown
Contributor

Failing Test for AddDefaultValueForUndefinedVariableRector

Based on https://getrector.com/demo/e1b4cf4e-c34f-466d-ac1a-4ecdbffca61c

See rectorphp/rector#7777

…r with infinite loop

# Failing Test for AddDefaultValueForUndefinedVariableRector

Based on https://getrector.com/demo/e1b4cf4e-c34f-466d-ac1a-4ecdbffca61c
@samsonasik
Copy link
Copy Markdown
Member

@jackbentley I cherry-picked your commit at PR #3390

@samsonasik
Copy link
Copy Markdown
Member

I am not sure if this fixable, 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;

samsonasik added a commit that referenced this pull request Feb 19, 2023
…leRector (#3390)

* Add failing test fixture for AddDefaultValueForUndefinedVariableRector with infinite loop

# Failing Test for AddDefaultValueForUndefinedVariableRector

Based on https://getrector.com/demo/e1b4cf4e-c34f-466d-ac1a-4ecdbffca61c

* rename fixture

* Closes #3388 Fixes rectorphp/rector#7777

* remove comment

* add more failing fixture

* rollback

* fix

* Fix

* Fix

* Final touch: clean up

* Final touch: clean up

* Final touch: clean up

* Really Really Final touch: verify when parent is Closure Expr

---------

Co-authored-by: Jack Bentley <jackbentley@iname.com>
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