diff --git a/rules-tests/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector/Fixture/skip_with_html.php.inc b/rules-tests/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector/Fixture/skip_with_html.php.inc new file mode 100644 index 00000000000..685f9ffd037 --- /dev/null +++ b/rules-tests/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector/Fixture/skip_with_html.php.inc @@ -0,0 +1,9 @@ + + Always visible +cond instanceof BooleanAnd) { - return $this->refactorIfWithBooleanAnd($node); - } - if ($node->else instanceof Else_) { return null; } - // just one if + // not just one if if ($node->elseifs !== []) { return null; } + if ($this->getFile()->containsHTML()) { + return null; + } + + if ($node->cond instanceof BooleanAnd) { + return $this->refactorIfWithBooleanAnd($node); + } + if ($this->shouldSkipExpr($node->cond)) { return null; }