Skip to content

Incorrect behavior of RemoveNextSameValueConditionRector #9585

@samsonasik

Description

@samsonasik

Bug Report

Subject Details
Rector version last dev-main
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/c02ef7ee-5660-4d91-8720-ca2d31d23892

<?php

if ($a) {
  echo 'a1';   
} 

if ($a) {
    echo 'a2';
} else {
 	echo 'b';   
}

Responsible rules

  • RemoveNextSameValueConditionRector

Expected Behavior

the part of:

 else {
 	echo 'b';   
}

should not be removed.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions