From a44912a7ec882f9b85d27376258228c1a8caad86 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Mon, 4 Apr 2022 18:41:05 +0200 Subject: [PATCH] Fix deprecations on Symfony 6.1 --- Command/CheckConfigCommand.php | 9 +++++++-- Command/GenerateKeyPairCommand.php | 5 +++++ Command/GenerateTokenCommand.php | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Command/CheckConfigCommand.php b/Command/CheckConfigCommand.php index df05a958..80b77d3c 100644 --- a/Command/CheckConfigCommand.php +++ b/Command/CheckConfigCommand.php @@ -3,17 +3,22 @@ namespace Lexik\Bundle\JWTAuthenticationBundle\Command; use Lexik\Bundle\JWTAuthenticationBundle\Services\KeyLoader\KeyLoaderInterface; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; /** - * CheckConfigCommand. - * * @author Nicolas Cabot + * + * @final */ +#[AsCommand(name: 'lexik:jwt:check-config', description: 'Checks that the bundle is properly configured.')] class CheckConfigCommand extends Command { + /** + * @deprecated + */ protected static $defaultName = 'lexik:jwt:check-config'; private $keyLoader; diff --git a/Command/GenerateKeyPairCommand.php b/Command/GenerateKeyPairCommand.php index 25b4d5b6..3873d39f 100644 --- a/Command/GenerateKeyPairCommand.php +++ b/Command/GenerateKeyPairCommand.php @@ -2,6 +2,7 @@ namespace Lexik\Bundle\JWTAuthenticationBundle\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\Console\Input\InputInterface; @@ -13,6 +14,7 @@ /** * @author Beno!t POLASZEK */ +#[AsCommand(name: 'lexik:jwt:generate-keypair', description: 'Generate public/private keys for use in your application.')] final class GenerateKeyPairCommand extends Command { private const ACCEPTED_ALGORITHMS = [ @@ -27,6 +29,9 @@ final class GenerateKeyPairCommand extends Command 'ES512', ]; + /** + * @deprecated + */ protected static $defaultName = 'lexik:jwt:generate-keypair'; /** diff --git a/Command/GenerateTokenCommand.php b/Command/GenerateTokenCommand.php index 112316b8..38378ae1 100644 --- a/Command/GenerateTokenCommand.php +++ b/Command/GenerateTokenCommand.php @@ -3,6 +3,7 @@ namespace Lexik\Bundle\JWTAuthenticationBundle\Command; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -15,8 +16,12 @@ * * @author Samuel Roze */ +#[AsCommand(name: 'lexik:jwt:generate-token', description: 'Generates a JWT token for a given user.')] class GenerateTokenCommand extends Command { + /** + * @deprecated + */ protected static $defaultName = 'lexik:jwt:generate-token'; private $tokenManager;