Run Rector on your code to see what it can do for you:

 <?php
 
 final class DemoFile
        */
       public function flatten(array $groups): array
       {
-          return array_merge(...array_values($groups));
+          return $groups
+              |> array_values(...)
+              |> array_merge(...);
       }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 3b8b78 - released at 2026-07-24 13:03