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

 <?php
 
 namespace App {
     use App\SomeTrait;
     use PHPUnit\Framework\TestCase;
 
-    /**
-     * @covers \App\SomeTrait
-     */
+    #[\PHPUnit\Framework\Attributes\CoversTrait(\App\SomeTrait::class)]
+    #[\PHPUnit\Framework\Attributes\CoversMethod(\App\OtherStuff::class, 'Inject')]
     final class SomeTraitTest extends TestCase
     {
-        /**
-         * @covers \App\OtherStuff::Inject
-         */
         public function testYourThinks(): void
         {}
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 2.3.8 - released at 2026-02-22 00:49