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

 $initials = implode(
     '',
     array_map(
-        static fn ($name): string => strtoupper((string) $name[0]),
+        static fn (array $name): string => strtoupper((string) $name[0]),
         explode('.', $username),
     ),
 );
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 142f1c - released at 2026-02-06 17:31