Change annotations with value to attribute
use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Attributes\BackupGlobals;
-/**
- * @backupGlobals enabled
- */
+#[BackupGlobals(true)]
final class SomeTest extends TestCase
{
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector;
use Rector\PHPUnit\ValueObject\AnnotationWithValueToAttribute;
return RectorConfig::configure()
->withConfiguredRule(AnnotationWithValueToAttributeRector::class, [
new AnnotationWithValueToAttribute('backupGlobals', 'PHPUnit\Framework\Attributes\BackupGlobals', [
'enabled' => true,
'disabled' => false,
]),
]);