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

 
 final class SomeClass
 {
-    public function example($array = []) 
+    public function example(array $array = []): array 
     {
         return $array;
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 540fbf - released at 2026-01-06 08:26