diff --git a/config/sets/symfony/level/up-to-symfony-62.php b/config/sets/symfony/level/up-to-symfony-62.php new file mode 100644 index 00000000..4c686192 --- /dev/null +++ b/config/sets/symfony/level/up-to-symfony-62.php @@ -0,0 +1,11 @@ +sets([SymfonySetList::SYMFONY_62, SymfonyLevelSetList::UP_TO_SYMFONY_60]); +}; diff --git a/config/sets/symfony/symfony43.php b/config/sets/symfony/symfony43.php index 8f018bc8..a9fbd60b 100644 --- a/config/sets/symfony/symfony43.php +++ b/config/sets/symfony/symfony43.php @@ -3,7 +3,6 @@ declare(strict_types=1); use Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector; - use Rector\Arguments\ValueObject\ArgumentAdder; use Rector\Config\RectorConfig; use Rector\Core\ValueObject\MethodName; diff --git a/config/sets/symfony/symfony60.php b/config/sets/symfony/symfony60.php index 28c7fcf7..c27b089d 100644 --- a/config/sets/symfony/symfony60.php +++ b/config/sets/symfony/symfony60.php @@ -3,7 +3,6 @@ declare(strict_types=1); use PhpParser\Node\Scalar\String_; - use PHPStan\Type\MixedType; use PHPStan\Type\ObjectType; use Rector\Config\RectorConfig; diff --git a/config/sets/symfony/symfony62.php b/config/sets/symfony/symfony62.php new file mode 100644 index 00000000..1741e618 --- /dev/null +++ b/config/sets/symfony/symfony62.php @@ -0,0 +1,21 @@ +ruleWithConfiguration( + RenameClassRector::class, + [ + // @see https://github.com/symfony/symfony/pull/46907 + 'Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted' => 'Symfony\Component\Security\Http\Attribute\IsGranted', + // @see https://github.com/symfony/symfony/pull/46880 + 'Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache' => 'Symfony\Component\HttpKernel\Attribute\Cache', + // @see https://github.com/symfony/symfony/pull/46906 + 'Sensio\Bundle\FrameworkExtraBundle\Configuration\Template' => 'Symfony\Bridge\Twig\Attribute\Template', + ], + ); +}; diff --git a/src/Set/SymfonyLevelSetList.php b/src/Set/SymfonyLevelSetList.php index 00b39758..209552ce 100644 --- a/src/Set/SymfonyLevelSetList.php +++ b/src/Set/SymfonyLevelSetList.php @@ -107,4 +107,9 @@ final class SymfonyLevelSetList implements SetListInterface * @var string */ final public const UP_TO_SYMFONY_60 = __DIR__ . '/../../config/sets/symfony/level/up-to-symfony-60.php'; + + /** + * @var string + */ + final public const UP_TO_SYMFONY_62 = __DIR__ . '/../../config/sets/symfony/level/up-to-symfony-62.php'; } diff --git a/src/Set/SymfonySetList.php b/src/Set/SymfonySetList.php index 1469c7b9..36d29fe5 100644 --- a/src/Set/SymfonySetList.php +++ b/src/Set/SymfonySetList.php @@ -123,6 +123,11 @@ final class SymfonySetList implements SetListInterface */ final public const SYMFONY_60 = __DIR__ . '/../../config/sets/symfony/symfony60.php'; + /** + * @var string + */ + final public const SYMFONY_62 = __DIR__ . '/../../config/sets/symfony/symfony62.php'; + /** * @var string */ diff --git a/tests/Set/Symfony62/Fixture/replace_sensio_cache.php.inc b/tests/Set/Symfony62/Fixture/replace_sensio_cache.php.inc new file mode 100644 index 00000000..3d0dd04f --- /dev/null +++ b/tests/Set/Symfony62/Fixture/replace_sensio_cache.php.inc @@ -0,0 +1,34 @@ + +----- + diff --git a/tests/Set/Symfony62/Fixture/replace_sensio_is_granted.php.inc b/tests/Set/Symfony62/Fixture/replace_sensio_is_granted.php.inc new file mode 100644 index 00000000..d7350f60 --- /dev/null +++ b/tests/Set/Symfony62/Fixture/replace_sensio_is_granted.php.inc @@ -0,0 +1,34 @@ + +----- + diff --git a/tests/Set/Symfony62/Fixture/replace_sensio_template.php.inc b/tests/Set/Symfony62/Fixture/replace_sensio_template.php.inc new file mode 100644 index 00000000..150dd44e --- /dev/null +++ b/tests/Set/Symfony62/Fixture/replace_sensio_template.php.inc @@ -0,0 +1,34 @@ + +----- + diff --git a/tests/Set/Symfony62/Symfony62Test.php b/tests/Set/Symfony62/Symfony62Test.php new file mode 100644 index 00000000..a1bc4b6b --- /dev/null +++ b/tests/Set/Symfony62/Symfony62Test.php @@ -0,0 +1,29 @@ +doTestFile($filePath); + } + + public function provideData(): Iterator + { + return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config/symfony62.php'; + } +} diff --git a/tests/Set/Symfony62/config/symfony62.php b/tests/Set/Symfony62/config/symfony62.php new file mode 100644 index 00000000..3e744097 --- /dev/null +++ b/tests/Set/Symfony62/config/symfony62.php @@ -0,0 +1,11 @@ +import(__DIR__ . '/../../../../config/config.php'); + $rectorConfig->sets([SymfonySetList::SYMFONY_62]); +};