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;
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 9305ed - released at 2026-06-02 00:27