From eade9977db1c099c27bbb67c19f56a4f32db5fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20H=C3=A9lias?= Date: Mon, 20 Feb 2023 22:08:43 +0100 Subject: [PATCH] Remove deprecation symfony 6.3 --- Command/CheckConfigCommand.php | 2 +- Command/GenerateTokenCommand.php | 2 +- .../Compiler/ApiPlatformOpenApiPass.php | 2 +- .../Compiler/DeprecateLegacyGuardAuthenticatorPass.php | 2 +- .../Compiler/WireGenerateTokenCommandPass.php | 2 +- .../LexikJWTAuthenticationExtension.php | 2 +- .../Security/Factory/JWTAuthenticatorFactoryTrait.php | 2 +- .../Security/Factory/JWTUserFactory.php | 6 +++--- LexikJWTAuthenticationBundle.php | 10 +--------- .../Bundle/DependencyInjection/BundleExtension.php | 4 ++-- Tests/Functional/app/AppKernel.php | 8 ++++---- 11 files changed, 17 insertions(+), 25 deletions(-) diff --git a/Command/CheckConfigCommand.php b/Command/CheckConfigCommand.php index 79c9e13a..b3d4dedb 100644 --- a/Command/CheckConfigCommand.php +++ b/Command/CheckConfigCommand.php @@ -36,7 +36,7 @@ public function __construct(KeyLoaderInterface $keyLoader, $signatureAlgorithm) /** * {@inheritdoc} */ - protected function configure() + protected function configure(): void { $this ->setName(static::$defaultName) diff --git a/Command/GenerateTokenCommand.php b/Command/GenerateTokenCommand.php index f7eb7a00..3d96fe6d 100644 --- a/Command/GenerateTokenCommand.php +++ b/Command/GenerateTokenCommand.php @@ -40,7 +40,7 @@ public function __construct(JWTTokenManagerInterface $tokenManager, \Traversable /** * {@inheritdoc} */ - protected function configure() + protected function configure(): void { $this ->setName(static::$defaultName) diff --git a/DependencyInjection/Compiler/ApiPlatformOpenApiPass.php b/DependencyInjection/Compiler/ApiPlatformOpenApiPass.php index bab7eecc..469290c2 100644 --- a/DependencyInjection/Compiler/ApiPlatformOpenApiPass.php +++ b/DependencyInjection/Compiler/ApiPlatformOpenApiPass.php @@ -7,7 +7,7 @@ class ApiPlatformOpenApiPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('lexik_jwt_authentication.api_platform.openapi.factory') || !$container->hasParameter('security.firewalls')) { return; diff --git a/DependencyInjection/Compiler/DeprecateLegacyGuardAuthenticatorPass.php b/DependencyInjection/Compiler/DeprecateLegacyGuardAuthenticatorPass.php index f5a3ca59..4d5fe2b5 100644 --- a/DependencyInjection/Compiler/DeprecateLegacyGuardAuthenticatorPass.php +++ b/DependencyInjection/Compiler/DeprecateLegacyGuardAuthenticatorPass.php @@ -14,7 +14,7 @@ */ class DeprecateLegacyGuardAuthenticatorPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasParameter('lexik_jwt_authentication.authenticator_manager_enabled') || !$container->getParameter('lexik_jwt_authentication.authenticator_manager_enabled')) { return; diff --git a/DependencyInjection/Compiler/WireGenerateTokenCommandPass.php b/DependencyInjection/Compiler/WireGenerateTokenCommandPass.php index 55dafa14..173c77f6 100644 --- a/DependencyInjection/Compiler/WireGenerateTokenCommandPass.php +++ b/DependencyInjection/Compiler/WireGenerateTokenCommandPass.php @@ -7,7 +7,7 @@ class WireGenerateTokenCommandPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('lexik_jwt_authentication.generate_token_command') || !$container->hasDefinition('security.context_listener')) { return; diff --git a/DependencyInjection/LexikJWTAuthenticationExtension.php b/DependencyInjection/LexikJWTAuthenticationExtension.php index 11e9e89a..baf10ab0 100644 --- a/DependencyInjection/LexikJWTAuthenticationExtension.php +++ b/DependencyInjection/LexikJWTAuthenticationExtension.php @@ -26,7 +26,7 @@ class LexikJWTAuthenticationExtension extends Extension /** * {@inheritdoc} */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); diff --git a/DependencyInjection/Security/Factory/JWTAuthenticatorFactoryTrait.php b/DependencyInjection/Security/Factory/JWTAuthenticatorFactoryTrait.php index 994b51ae..d3c5f8da 100644 --- a/DependencyInjection/Security/Factory/JWTAuthenticatorFactoryTrait.php +++ b/DependencyInjection/Security/Factory/JWTAuthenticatorFactoryTrait.php @@ -48,7 +48,7 @@ public function getKey(): string /** * {@inheritdoc} */ - public function addConfiguration(NodeDefinition $node) + public function addConfiguration(NodeDefinition $node): void { $node ->children() diff --git a/DependencyInjection/Security/Factory/JWTUserFactory.php b/DependencyInjection/Security/Factory/JWTUserFactory.php index f013f032..96811314 100644 --- a/DependencyInjection/Security/Factory/JWTUserFactory.php +++ b/DependencyInjection/Security/Factory/JWTUserFactory.php @@ -18,18 +18,18 @@ */ final class JWTUserFactory implements UserProviderFactoryInterface { - public function create(ContainerBuilder $container, $id, $config) + public function create(ContainerBuilder $container, $id, $config): void { $container->setDefinition($id, new ChildDefinition('lexik_jwt_authentication.security.jwt_user_provider')) ->replaceArgument(0, $config['class']); } - public function getKey() + public function getKey(): string { return 'lexik_jwt'; } - public function addConfiguration(NodeDefinition $node) + public function addConfiguration(NodeDefinition $node): void { $node ->children() diff --git a/LexikJWTAuthenticationBundle.php b/LexikJWTAuthenticationBundle.php index 2f7b9ee1..e1e133f7 100644 --- a/LexikJWTAuthenticationBundle.php +++ b/LexikJWTAuthenticationBundle.php @@ -27,7 +27,7 @@ class LexikJWTAuthenticationBundle extends Bundle /** * {@inheritdoc} */ - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { parent::build($container); @@ -59,12 +59,4 @@ public function build(ContainerBuilder $container) $extension->addSecurityListenerFactory(new JWTFactory(false)); // BC 1.x, to be removed in 3.0 } } - - /** - * {@inheritdoc} - */ - public function registerCommands(Application $application) - { - // noop - } } diff --git a/Tests/Functional/Bundle/DependencyInjection/BundleExtension.php b/Tests/Functional/Bundle/DependencyInjection/BundleExtension.php index 3fa5dcd8..ad0a9be1 100644 --- a/Tests/Functional/Bundle/DependencyInjection/BundleExtension.php +++ b/Tests/Functional/Bundle/DependencyInjection/BundleExtension.php @@ -12,7 +12,7 @@ class BundleExtension extends Extension implements PrependExtensionInterface /** * {@inheritdoc} */ - public function prepend(ContainerBuilder $container) + public function prepend(ContainerBuilder $container): void { // Annotation must be disabled since this bundle doesn't use Doctrine // The framework allows enabling/disabling them only since symfony 3.2 where @@ -29,7 +29,7 @@ public function prepend(ContainerBuilder $container) /** * {@inheritdoc} */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { } } diff --git a/Tests/Functional/app/AppKernel.php b/Tests/Functional/app/AppKernel.php index 6ce14f75..3559fb56 100644 --- a/Tests/Functional/app/AppKernel.php +++ b/Tests/Functional/app/AppKernel.php @@ -7,8 +7,8 @@ use Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\Bundle\Bundle; use Psr\Log\NullLogger; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; +use Symfony\Bundle\SecurityBundle\Security; use Symfony\Bundle\SecurityBundle\SecurityBundle; -use Symfony\Bundle\SecurityBundle\SecurityBundle\Security; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel; @@ -55,7 +55,7 @@ public function registerBundles(): array return $bundles; } - public function getRootDir() + public function getRootDir(): string { return __DIR__; } @@ -79,7 +79,7 @@ public function getLogDir(): string /** * {@inheritdoc} */ - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(__DIR__ . '/config/config_router_utf8.yml'); @@ -159,7 +159,7 @@ public function getEncoder() return $this->encoder; } - protected function build(ContainerBuilder $container) + protected function build(ContainerBuilder $container): void { $container->register('logger', NullLogger::class);