Skip to content

Add failing test fixture for RemoveAlwaysTrueIfConditionRector#3336

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

Add failing test fixture for RemoveAlwaysTrueIfConditionRector#3336
Naugrimm wants to merge 1 commit intorectorphp:mainfrom
Naugrimm:patch-1

Conversation

@Naugrimm
Copy link
Copy Markdown
Contributor

@Naugrimm Naugrimm commented Feb 4, 2023

Failing Test for RemoveAlwaysTrueIfConditionRector

Based on https://getrector.com/demo/e8d55b28-49e1-46ff-81df-2866f17b85f3

see rectorphp/rector#7757

samsonasik added a commit that referenced this pull request Feb 12, 2023
@samsonasik
Copy link
Copy Markdown
Member

@Naugrimm could you try provide a patch for it, you can verify if the If_ cond has Assign_ inside it, something like:

    $hasAssign = (bool) $this->betterNodeFinder->findInstanceOf($node->cond, \PhpParser\Node\Expr\Assign::class);
    if ($hasAssign) {
        return null;
    }

@samsonasik
Copy link
Copy Markdown
Member

@Naugrimm I cherry-picked your commit at PR #3447

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