Run Rector on your code to see what it can do for you:
<?php final class DemoFile
{ public function calculatePrice($qty, $cond, $price, $price2) { - if ($qty < 1) { - } elseif (!$cond) { - $total = $qty * $price1; - } else { - $total = $qty * $price2; + if ($qty >= 1 && !$cond) { + $total = $qty * $price1; } return $total; } }
Applied Rules:
Not a change you expect?
rector.php