Find the best Rector rule to solve your problem. Searching through 661 rules.

Found 6 rules:

TicketAnnotationToAttributeRector

Change annotations with value to attribute

 use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Attributes\Ticket;

-/**
- * @ticket 123
- */
+#[Ticket('123')]
 final class SomeTest extends TestCase
 {
 }

CoversAnnotationWithValueToAttributeRector

Change covers annotations with value to attribute

 use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Attributes\CoversClass;
+use PHPUnit\Framework\Attributes\CoversFunction;

-/**
- * @covers SomeClass
- */
+#[CoversClass(SomeClass::class)]
+#[CoversFunction('someFunction')]
 final class SomeTest extends TestCase
 {
-    /**
-     * @covers ::someFunction()
-     */
     public function test()
     {
     }
 }

RequiresAnnotationWithValueToAttributeRector

Change Requires annotations with values to attributes

 use PHPUnit\Framework\TestCase;

-/**
- * @requires PHP > 8.4
- * @requires PHPUnit >= 10
- * @requires OS Windows
- * @requires OSFAMILY Darwin
- * @requires function someFunction
- * @requires function \some\className::someMethod
- * @requires extension mysqli
- * @requires extension mysqli >= 8.3.0
- * @requires setting date.timezone Europe/Berlin
- */
-
+#[\PHPUnit\Framework\Attributes\RequiresPhp('> 8.4')]
+#[\PHPUnit\Framework\Attributes\RequiresPhpunit('>= 10')]
+#[\PHPUnit\Framework\Attributes\RequiresOperatingSystem('Windows')]
+#[\PHPUnit\Framework\Attributes\RequiresOperatingSystemFamily('Darwin')]
+#[\PHPUnit\Framework\Attributes\RequiresFunction('someFunction')]
+#[\PHPUnit\Framework\Attributes\RequiresMethod(\some\className::class, 'someMethod')]
+#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mysqli')]
+#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mysqli', '>= 8.3.0')]
+#[\PHPUnit\Framework\Attributes\RequiresSetting('date.timezone', 'Europe/Berlin')]
 final class SomeTest extends TestCase
 {
-    /**
-     * @requires PHP > 8.4
-     * @requires PHPUnit >= 10
-     * @requires OS Windows
-     * @requires OSFAMILY Darwin
-     * @requires function someFunction
-     * @requires function \some\className::someMethod
-     * @requires extension mysqli
-     * @requires extension mysqli >= 8.3.0
-     * @requires setting date.timezone Europe/Berlin
-     */
+
+    #[\PHPUnit\Framework\Attributes\RequiresPhp('> 8.4')]
+    #[\PHPUnit\Framework\Attributes\RequiresPhpunit('>= 10')]
+    #[\PHPUnit\Framework\Attributes\RequiresOperatingSystem('Windows')]
+    #[\PHPUnit\Framework\Attributes\RequiresOperatingSystemFamily('Darwin')]
+    #[\PHPUnit\Framework\Attributes\RequiresFunction('someFunction')]
+    #[\PHPUnit\Framework\Attributes\RequiresMethod(\some\className::class, 'someMethod')]
+    #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mysqli')]
+    #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mysqli', '>= 8.3.0')]
+    #[\PHPUnit\Framework\Attributes\RequiresSetting('date.timezone', 'Europe/Berlin')]
     public function test()
     {
     }
 }

DependsAnnotationWithValueToAttributeRector

Change depends annotations with value to attribute

 use PHPUnit\Framework\TestCase;

 final class SomeTest extends TestCase
 {
     public function testOne() {}

-    /**
-     * @depends testOne
-     */
+    #[\PHPUnit\Framework\Attributes\Depends('testOne')]
     public function testThree(): void
     {
     }
 }

TestWithAnnotationToAttributeRector

Change @testWith() annotation to #[TestWith] attribute

 use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Attributes\TestWith;

 final class SomeFixture extends TestCase
 {
-    /**
-     * @testWith ["foo"]
-     *           ["bar"]
-     */
+    #[TestWith(['foo'])]
+    #[TestWith(['bar'])]
     public function test(): void
     {
     }
 }

DataProviderAnnotationToAttributeRector

Change dataProvider annotations to attribute

 use PHPUnit\Framework\TestCase;

 final class SomeTest extends TestCase
 {
-    /**
-     * @dataProvider someMethod()
-     */
+    #[\PHPUnit\Framework\Attributes\DataProvider('someMethod')]
     public function test(): void
     {
     }
 }