From fbbdfdad637e223a32711848b2d833a180d60956 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Thu, 1 Feb 2024 04:52:11 -0500 Subject: [PATCH] [make:*] use *\Routing\Attribute\* instead of *\Routing\Annotation\* --- src/Maker/MakeAuthenticator.php | 2 +- src/Maker/MakeController.php | 2 +- src/Maker/MakeCrud.php | 2 +- src/Maker/MakeRegistrationForm.php | 2 +- src/Maker/MakeResetPassword.php | 2 +- src/Maker/Security/MakeFormLogin.php | 2 +- src/Security/SecurityControllerBuilder.php | 2 +- tests/Security/fixtures/expected/SecurityController_login.php | 2 +- .../fixtures/expected/SecurityController_login_logout.php | 2 +- .../Security/fixtures/expected/SecurityController_logout.php | 2 +- tests/Util/ClassSourceManipulatorTest.php | 2 +- tests/Util/UseStatementGeneratorTest.php | 4 ++-- tests/Util/fixtures/add_method/Controller_with_action.php | 2 +- tests/fixtures/make-crud/expected/WithCustomRepository.php | 2 +- .../standard_setup/src/Controller/TestingController.php | 2 +- .../security/make-form-login/expected/LoginController.php | 2 +- .../security/make-form-login/expected/SecurityController.php | 2 +- .../expected/SecurityControllerWithoutLogout.php | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Maker/MakeAuthenticator.php b/src/Maker/MakeAuthenticator.php index f2a048496..5ca317f3f 100644 --- a/src/Maker/MakeAuthenticator.php +++ b/src/Maker/MakeAuthenticator.php @@ -38,7 +38,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; diff --git a/src/Maker/MakeController.php b/src/Maker/MakeController.php index d08f512c0..e193ed9cf 100644 --- a/src/Maker/MakeController.php +++ b/src/Maker/MakeController.php @@ -26,7 +26,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; /** * @author Javier Eguiluz diff --git a/src/Maker/MakeCrud.php b/src/Maker/MakeCrud.php index d1bfc1085..45f94ef16 100644 --- a/src/Maker/MakeCrud.php +++ b/src/Maker/MakeCrud.php @@ -36,7 +36,7 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Csrf\CsrfTokenManager; use Symfony\Component\Validator\Validation; diff --git a/src/Maker/MakeRegistrationForm.php b/src/Maker/MakeRegistrationForm.php index 06966b8d6..a9ace9a68 100644 --- a/src/Maker/MakeRegistrationForm.php +++ b/src/Maker/MakeRegistrationForm.php @@ -46,7 +46,7 @@ use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mime\Address; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authentication\UserAuthenticatorInterface; diff --git a/src/Maker/MakeResetPassword.php b/src/Maker/MakeResetPassword.php index bf19d3b65..2748f581d 100644 --- a/src/Maker/MakeResetPassword.php +++ b/src/Maker/MakeResetPassword.php @@ -49,7 +49,7 @@ use Symfony\Component\Mime\Address; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Translation\Translator; use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; diff --git a/src/Maker/Security/MakeFormLogin.php b/src/Maker/Security/MakeFormLogin.php index b20a62d1d..072346bab 100644 --- a/src/Maker/Security/MakeFormLogin.php +++ b/src/Maker/Security/MakeFormLogin.php @@ -33,7 +33,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; use Symfony\Component\Yaml\Yaml; diff --git a/src/Security/SecurityControllerBuilder.php b/src/Security/SecurityControllerBuilder.php index 5c74a0f85..5613e2029 100644 --- a/src/Security/SecurityControllerBuilder.php +++ b/src/Security/SecurityControllerBuilder.php @@ -14,7 +14,7 @@ use PhpParser\Builder\Param; use Symfony\Bundle\MakerBundle\Util\ClassSourceManipulator; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; /** diff --git a/tests/Security/fixtures/expected/SecurityController_login.php b/tests/Security/fixtures/expected/SecurityController_login.php index 6771f2c9c..fe3a0b6aa 100644 --- a/tests/Security/fixtures/expected/SecurityController_login.php +++ b/tests/Security/fixtures/expected/SecurityController_login.php @@ -4,7 +4,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class SecurityController extends AbstractController diff --git a/tests/Security/fixtures/expected/SecurityController_login_logout.php b/tests/Security/fixtures/expected/SecurityController_login_logout.php index 15b59ced0..2133610be 100644 --- a/tests/Security/fixtures/expected/SecurityController_login_logout.php +++ b/tests/Security/fixtures/expected/SecurityController_login_logout.php @@ -4,7 +4,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class SecurityController extends AbstractController diff --git a/tests/Security/fixtures/expected/SecurityController_logout.php b/tests/Security/fixtures/expected/SecurityController_logout.php index 07fc8086c..e10de7a92 100644 --- a/tests/Security/fixtures/expected/SecurityController_logout.php +++ b/tests/Security/fixtures/expected/SecurityController_logout.php @@ -3,7 +3,7 @@ namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class SecurityController extends AbstractController { diff --git a/tests/Util/ClassSourceManipulatorTest.php b/tests/Util/ClassSourceManipulatorTest.php index 737a69b63..33c44fb9c 100644 --- a/tests/Util/ClassSourceManipulatorTest.php +++ b/tests/Util/ClassSourceManipulatorTest.php @@ -708,7 +708,7 @@ public function testAddMethodWithBody(): void ); $manipulator->addMethodBuilder($methodBuilder); $manipulator->addUseStatementIfNecessary('Symfony\\Component\\HttpFoundation\\JsonResponse'); - $manipulator->addUseStatementIfNecessary('Symfony\\Component\\Routing\\Annotation\\Route'); + $manipulator->addUseStatementIfNecessary('Symfony\\Component\\Routing\\Attribute\\Route'); $this->assertSame($expectedSource, $manipulator->getSourceCode()); } diff --git a/tests/Util/UseStatementGeneratorTest.php b/tests/Util/UseStatementGeneratorTest.php index 53fdf8144..392280d57 100644 --- a/tests/Util/UseStatementGeneratorTest.php +++ b/tests/Util/UseStatementGeneratorTest.php @@ -48,7 +48,7 @@ public function testComplexStatements(): void \Symfony\Bridge\Twig\Mime\TemplatedEmail::class, \Symfony\Component\HttpFoundation\Request::class, \Symfony\Component\HttpFoundation\Response::class, - \Symfony\Component\Routing\Annotation\Route::class, + \Symfony\Component\Routing\Attribute\Route::class, \Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface::class, \App\Security\EmailVerifier::class, \Symfony\Component\Mime\Address::class, @@ -66,7 +66,7 @@ public function testComplexStatements(): void use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Mime\Address; - use Symfony\Component\Routing\Annotation\Route; + use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface; diff --git a/tests/Util/fixtures/add_method/Controller_with_action.php b/tests/Util/fixtures/add_method/Controller_with_action.php index e321f2732..6cbe45eb7 100644 --- a/tests/Util/fixtures/add_method/Controller_with_action.php +++ b/tests/Util/fixtures/add_method/Controller_with_action.php @@ -3,7 +3,7 @@ namespace App\Controller; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class EmptyController { diff --git a/tests/fixtures/make-crud/expected/WithCustomRepository.php b/tests/fixtures/make-crud/expected/WithCustomRepository.php index 6f94f1237..bab5efc18 100644 --- a/tests/fixtures/make-crud/expected/WithCustomRepository.php +++ b/tests/fixtures/make-crud/expected/WithCustomRepository.php @@ -9,7 +9,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; #[Route('/sweet/food')] class SweetFoodController extends AbstractController diff --git a/tests/fixtures/make-registration-form/standard_setup/src/Controller/TestingController.php b/tests/fixtures/make-registration-form/standard_setup/src/Controller/TestingController.php index d03a8bde9..559cf511d 100644 --- a/tests/fixtures/make-registration-form/standard_setup/src/Controller/TestingController.php +++ b/tests/fixtures/make-registration-form/standard_setup/src/Controller/TestingController.php @@ -4,7 +4,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class TestingController extends AbstractController { diff --git a/tests/fixtures/security/make-form-login/expected/LoginController.php b/tests/fixtures/security/make-form-login/expected/LoginController.php index 5355f737f..9ceecd322 100644 --- a/tests/fixtures/security/make-form-login/expected/LoginController.php +++ b/tests/fixtures/security/make-form-login/expected/LoginController.php @@ -4,7 +4,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class LoginController extends AbstractController diff --git a/tests/fixtures/security/make-form-login/expected/SecurityController.php b/tests/fixtures/security/make-form-login/expected/SecurityController.php index 5e4022d14..76bf5c4f2 100644 --- a/tests/fixtures/security/make-form-login/expected/SecurityController.php +++ b/tests/fixtures/security/make-form-login/expected/SecurityController.php @@ -4,7 +4,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class SecurityController extends AbstractController diff --git a/tests/fixtures/security/make-form-login/expected/SecurityControllerWithoutLogout.php b/tests/fixtures/security/make-form-login/expected/SecurityControllerWithoutLogout.php index b3640590a..d0d05b6cb 100644 --- a/tests/fixtures/security/make-form-login/expected/SecurityControllerWithoutLogout.php +++ b/tests/fixtures/security/make-form-login/expected/SecurityControllerWithoutLogout.php @@ -4,7 +4,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class SecurityController extends AbstractController