diff --git a/src/Command/AddUserCommand.php b/src/Command/AddUserCommand.php index 0454fc7fe..a5456141c 100644 --- a/src/Command/AddUserCommand.php +++ b/src/Command/AddUserCommand.php @@ -51,7 +51,7 @@ name: 'app:add-user', description: 'Creates users and stores them in the database' )] -class AddUserCommand extends Command +final class AddUserCommand extends Command { private SymfonyStyle $io; diff --git a/src/Command/DeleteUserCommand.php b/src/Command/DeleteUserCommand.php index 1ec8716ed..9a533924f 100644 --- a/src/Command/DeleteUserCommand.php +++ b/src/Command/DeleteUserCommand.php @@ -43,7 +43,7 @@ name: 'app:delete-user', description: 'Deletes users from the database' )] -class DeleteUserCommand extends Command +final class DeleteUserCommand extends Command { private SymfonyStyle $io; diff --git a/src/Command/ListUsersCommand.php b/src/Command/ListUsersCommand.php index 43e5fd7bd..85b96a890 100644 --- a/src/Command/ListUsersCommand.php +++ b/src/Command/ListUsersCommand.php @@ -43,7 +43,7 @@ description: 'Lists all the existing users', aliases: ['app:users'] )] -class ListUsersCommand extends Command +final class ListUsersCommand extends Command { public function __construct( private readonly MailerInterface $mailer, diff --git a/src/Controller/Admin/BlogController.php b/src/Controller/Admin/BlogController.php index 9c875b291..819e04e65 100644 --- a/src/Controller/Admin/BlogController.php +++ b/src/Controller/Admin/BlogController.php @@ -39,7 +39,7 @@ */ #[Route('/admin/post')] #[IsGranted(User::ROLE_ADMIN)] -class BlogController extends AbstractController +final class BlogController extends AbstractController { /** * Lists all Post entities. diff --git a/src/Controller/BlogController.php b/src/Controller/BlogController.php index 0490cd435..6b4711c01 100644 --- a/src/Controller/BlogController.php +++ b/src/Controller/BlogController.php @@ -36,7 +36,7 @@ * @author Javier Eguiluz */ #[Route('/blog')] -class BlogController extends AbstractController +final class BlogController extends AbstractController { /** * NOTE: For standard formats, Symfony will also automatically choose the best diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index a943e6a4f..e1346883e 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -27,7 +27,7 @@ * @author Ryan Weaver * @author Javier Eguiluz */ -class SecurityController extends AbstractController +final class SecurityController extends AbstractController { use TargetPathTrait; diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index dd5b4d117..6c2879f87 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -32,7 +32,7 @@ * @author Romain Monteil */ #[Route('/profile'), IsGranted(User::ROLE_USER)] -class UserController extends AbstractController +final class UserController extends AbstractController { #[Route('/edit', name: 'user_edit', methods: ['GET', 'POST'])] public function edit( diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php index 4b3848000..5485a508a 100644 --- a/src/DataFixtures/AppFixtures.php +++ b/src/DataFixtures/AppFixtures.php @@ -22,7 +22,7 @@ use Symfony\Component\String\Slugger\SluggerInterface; use function Symfony\Component\String\u; -class AppFixtures extends Fixture +final class AppFixtures extends Fixture { public function __construct( private readonly UserPasswordHasherInterface $passwordHasher, diff --git a/src/Event/CommentCreatedEvent.php b/src/Event/CommentCreatedEvent.php index 39577a2b6..f8d74cb1c 100644 --- a/src/Event/CommentCreatedEvent.php +++ b/src/Event/CommentCreatedEvent.php @@ -14,7 +14,7 @@ use App\Entity\Comment; use Symfony\Contracts\EventDispatcher\Event; -class CommentCreatedEvent extends Event +final class CommentCreatedEvent extends Event { public function __construct( protected Comment $comment diff --git a/src/EventSubscriber/CheckRequirementsSubscriber.php b/src/EventSubscriber/CheckRequirementsSubscriber.php index 538cc969d..1665aa250 100644 --- a/src/EventSubscriber/CheckRequirementsSubscriber.php +++ b/src/EventSubscriber/CheckRequirementsSubscriber.php @@ -29,7 +29,7 @@ * * @author Javier Eguiluz */ -class CheckRequirementsSubscriber implements EventSubscriberInterface +final class CheckRequirementsSubscriber implements EventSubscriberInterface { public function __construct( private readonly EntityManagerInterface $entityManager diff --git a/src/EventSubscriber/CommentNotificationSubscriber.php b/src/EventSubscriber/CommentNotificationSubscriber.php index 9f63ffdcc..d6abc2c2e 100644 --- a/src/EventSubscriber/CommentNotificationSubscriber.php +++ b/src/EventSubscriber/CommentNotificationSubscriber.php @@ -25,7 +25,7 @@ * * @author Oleg Voronkovich */ -class CommentNotificationSubscriber implements EventSubscriberInterface +final class CommentNotificationSubscriber implements EventSubscriberInterface { public function __construct( private readonly MailerInterface $mailer, diff --git a/src/EventSubscriber/ControllerSubscriber.php b/src/EventSubscriber/ControllerSubscriber.php index b44827e0e..5fc857410 100644 --- a/src/EventSubscriber/ControllerSubscriber.php +++ b/src/EventSubscriber/ControllerSubscriber.php @@ -23,7 +23,7 @@ * @author Ryan Weaver * @author Javier Eguiluz */ -class ControllerSubscriber implements EventSubscriberInterface +final class ControllerSubscriber implements EventSubscriberInterface { public function __construct( private readonly SourceCodeExtension $twigExtension diff --git a/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php b/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php index 849f7e1f5..a45b1c4bf 100644 --- a/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php +++ b/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php @@ -26,7 +26,7 @@ * * @author Oleg Voronkovich */ -class RedirectToPreferredLocaleSubscriber implements EventSubscriberInterface +final class RedirectToPreferredLocaleSubscriber implements EventSubscriberInterface { /** * @var string[] diff --git a/src/Form/ChangePasswordType.php b/src/Form/ChangePasswordType.php index 48f6f847d..bed8dee98 100644 --- a/src/Form/ChangePasswordType.php +++ b/src/Form/ChangePasswordType.php @@ -26,7 +26,7 @@ * * @author Romain Monteil */ -class ChangePasswordType extends AbstractType +final class ChangePasswordType extends AbstractType { /** * {@inheritdoc} diff --git a/src/Form/CommentType.php b/src/Form/CommentType.php index 38ad43c7e..14b77c9a2 100644 --- a/src/Form/CommentType.php +++ b/src/Form/CommentType.php @@ -27,7 +27,7 @@ * @author Ryan Weaver * @author Javier Eguiluz */ -class CommentType extends AbstractType +final class CommentType extends AbstractType { /** * {@inheritdoc} diff --git a/src/Form/DataTransformer/TagArrayToStringTransformer.php b/src/Form/DataTransformer/TagArrayToStringTransformer.php index 1579c74e8..b8324704b 100644 --- a/src/Form/DataTransformer/TagArrayToStringTransformer.php +++ b/src/Form/DataTransformer/TagArrayToStringTransformer.php @@ -27,7 +27,7 @@ * * @template-implements DataTransformerInterface */ -class TagArrayToStringTransformer implements DataTransformerInterface +final class TagArrayToStringTransformer implements DataTransformerInterface { public function __construct( private readonly TagRepository $tags diff --git a/src/Form/PostType.php b/src/Form/PostType.php index fbef7287c..1d4050401 100644 --- a/src/Form/PostType.php +++ b/src/Form/PostType.php @@ -29,7 +29,7 @@ * @author Javier Eguiluz * @author Yonel Ceruto */ -class PostType extends AbstractType +final class PostType extends AbstractType { // Form types are services, so you can inject other services in them if needed public function __construct( diff --git a/src/Form/Type/DateTimePickerType.php b/src/Form/Type/DateTimePickerType.php index b33d0e4d3..664a5bf39 100644 --- a/src/Form/Type/DateTimePickerType.php +++ b/src/Form/Type/DateTimePickerType.php @@ -27,7 +27,7 @@ * * @author Yonel Ceruto */ -class DateTimePickerType extends AbstractType +final class DateTimePickerType extends AbstractType { public function __construct( private readonly MomentFormatConverter $formatConverter diff --git a/src/Form/Type/TagsInputType.php b/src/Form/Type/TagsInputType.php index 920b764a1..a0bd588ab 100644 --- a/src/Form/Type/TagsInputType.php +++ b/src/Form/Type/TagsInputType.php @@ -28,7 +28,7 @@ * * @author Yonel Ceruto */ -class TagsInputType extends AbstractType +final class TagsInputType extends AbstractType { public function __construct( private readonly TagRepository $tags diff --git a/src/Form/UserType.php b/src/Form/UserType.php index 835d6ad57..3496b45cc 100644 --- a/src/Form/UserType.php +++ b/src/Form/UserType.php @@ -23,7 +23,7 @@ * * @author Romain Monteil */ -class UserType extends AbstractType +final class UserType extends AbstractType { /** * {@inheritdoc} diff --git a/src/Kernel.php b/src/Kernel.php index 07997857d..071de6ff6 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -14,7 +14,7 @@ use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\HttpKernel\Kernel as BaseKernel; -class Kernel extends BaseKernel +final class Kernel extends BaseKernel { use MicroKernelTrait; } diff --git a/src/Pagination/Paginator.php b/src/Pagination/Paginator.php index e6c465b2a..12e65c300 100644 --- a/src/Pagination/Paginator.php +++ b/src/Pagination/Paginator.php @@ -18,7 +18,7 @@ /** * @author Javier Eguiluz */ -class Paginator +final class Paginator { /** * Use constants to define configuration options that rarely change instead diff --git a/src/Security/PostVoter.php b/src/Security/PostVoter.php index ad48bd0b5..7bac76c5e 100644 --- a/src/Security/PostVoter.php +++ b/src/Security/PostVoter.php @@ -24,7 +24,7 @@ * * @author Yonel Ceruto */ -class PostVoter extends Voter +final class PostVoter extends Voter { // Defining these constants is overkill for this simple application, but for real // applications, it's a recommended practice to avoid relying on "magic strings" diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index e5fa08682..46f0d584b 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -22,7 +22,7 @@ * @author Javier Eguiluz * @author Julien ITARD */ -class AppExtension extends AbstractExtension +final class AppExtension extends AbstractExtension { /** * @var string[] diff --git a/src/Twig/SourceCodeExtension.php b/src/Twig/SourceCodeExtension.php index fa8871518..483d03405 100644 --- a/src/Twig/SourceCodeExtension.php +++ b/src/Twig/SourceCodeExtension.php @@ -26,7 +26,7 @@ * @author Ryan Weaver * @author Javier Eguiluz */ -class SourceCodeExtension extends AbstractExtension +final class SourceCodeExtension extends AbstractExtension { /** * @var callable|null diff --git a/src/Utils/MomentFormatConverter.php b/src/Utils/MomentFormatConverter.php index b016e32e6..88df2cd71 100644 --- a/src/Utils/MomentFormatConverter.php +++ b/src/Utils/MomentFormatConverter.php @@ -16,7 +16,7 @@ * * @author Yonel Ceruto */ -class MomentFormatConverter +final class MomentFormatConverter { /** * This defines the mapping between PHP ICU date format (key) and moment.js date format (value) diff --git a/src/Utils/Validator.php b/src/Utils/Validator.php index 28a23346d..def71a2a0 100644 --- a/src/Utils/Validator.php +++ b/src/Utils/Validator.php @@ -21,7 +21,7 @@ * * @author Javier Eguiluz */ -class Validator +final class Validator { public function validateUsername(?string $username): string { diff --git a/tests/Command/AddUserCommandTest.php b/tests/Command/AddUserCommandTest.php index 75ead65cb..240c2497e 100644 --- a/tests/Command/AddUserCommandTest.php +++ b/tests/Command/AddUserCommandTest.php @@ -15,7 +15,7 @@ use App\Repository\UserRepository; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; -class AddUserCommandTest extends AbstractCommandTest +final class AddUserCommandTest extends AbstractCommandTest { /** * @var string[] diff --git a/tests/Command/ListUsersCommandTest.php b/tests/Command/ListUsersCommandTest.php index b34a8de36..78fb50951 100644 --- a/tests/Command/ListUsersCommandTest.php +++ b/tests/Command/ListUsersCommandTest.php @@ -13,7 +13,7 @@ use App\Command\ListUsersCommand; -class ListUsersCommandTest extends AbstractCommandTest +final class ListUsersCommandTest extends AbstractCommandTest { /** * @dataProvider maxResultsProvider diff --git a/tests/Controller/BlogControllerTest.php b/tests/Controller/BlogControllerTest.php index df0d7d534..e20f649fe 100644 --- a/tests/Controller/BlogControllerTest.php +++ b/tests/Controller/BlogControllerTest.php @@ -26,7 +26,7 @@ * $ cd your-symfony-project/ * $ ./vendor/bin/phpunit */ -class BlogControllerTest extends WebTestCase +final class BlogControllerTest extends WebTestCase { public function testIndex(): void { diff --git a/tests/Controller/DefaultControllerTest.php b/tests/Controller/DefaultControllerTest.php index 463c3b3ad..804832f3a 100644 --- a/tests/Controller/DefaultControllerTest.php +++ b/tests/Controller/DefaultControllerTest.php @@ -26,7 +26,7 @@ * $ cd your-symfony-project/ * $ ./vendor/bin/phpunit */ -class DefaultControllerTest extends WebTestCase +final class DefaultControllerTest extends WebTestCase { /** * PHPUnit's data providers allow to execute the same tests repeated times diff --git a/tests/Controller/UserControllerTest.php b/tests/Controller/UserControllerTest.php index 82b043b07..8a73c4332 100644 --- a/tests/Controller/UserControllerTest.php +++ b/tests/Controller/UserControllerTest.php @@ -31,7 +31,7 @@ * $ cd your-symfony-project/ * $ ./vendor/bin/phpunit */ -class UserControllerTest extends WebTestCase +final class UserControllerTest extends WebTestCase { /** * @dataProvider getUrlsForAnonymousUsers diff --git a/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php b/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php index 6ecbc82b6..b79f3c3f3 100644 --- a/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php +++ b/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php @@ -21,7 +21,7 @@ * * See https://symfony.com/doc/current/testing/database.html */ -class TagArrayToStringTransformerTest extends TestCase +final class TagArrayToStringTransformerTest extends TestCase { /** * Ensures that tags are created correctly. diff --git a/tests/Utils/ValidatorTest.php b/tests/Utils/ValidatorTest.php index 0c061fa45..fca00baf4 100644 --- a/tests/Utils/ValidatorTest.php +++ b/tests/Utils/ValidatorTest.php @@ -14,7 +14,7 @@ use App\Utils\Validator; use PHPUnit\Framework\TestCase; -class ValidatorTest extends TestCase +final class ValidatorTest extends TestCase { private Validator $validator;