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

 <?php
 
 class UserControllerTest extends \PHPUnit\Framework\TestCase
 {
-    /**
-     * @testWith ["2", 2, "null", "true", "false", true, false]
-     *           ["benjamin.sisko@ds9.example.com"]
-     */
+    #[\PHPUnit\Framework\Attributes\TestWith([2, 2, null, true, false, true, false])]
+    #[\PHPUnit\Framework\Attributes\TestWith(['benjamin.sisko@ds9.example.com'])]
     public function testSomething(string $userId): void
     {
     }
 }
PHP snippet to change
Config  rector.php
Rector version: 3edca6 - released at 2025-03-28 17:26