From 4bdb995fdbb7a1901dce118993b99202cbe10388 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Wed, 24 Jan 2024 12:54:14 -0500 Subject: [PATCH] [ALLI-10624] Fix CS and deprecation notices. --- .github/workflows/test.yml | 3 +-- src/Command/PurgeQueueCommand.php | 9 ++++----- src/Command/StatsCommand.php | 5 ++--- src/DependencyInjection/PmgPheanstalkExtension.php | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad8fcc5..7eb3ac2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,9 +13,8 @@ jobs: strategy: matrix: include: - - php-version: 8.0 - - php-version: 8.1 - php-version: 8.2 + - php-version: 8.3 steps: - name: checkout diff --git a/src/Command/PurgeQueueCommand.php b/src/Command/PurgeQueueCommand.php index b1c7f57..07067f6 100644 --- a/src/Command/PurgeQueueCommand.php +++ b/src/Command/PurgeQueueCommand.php @@ -12,21 +12,20 @@ namespace PMG\PheanstalkBundle\Command; +use PMG\PheanstalkBundle\Service\QueueUtilities; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Pheanstalk\PheanstalkInterface; -use PMG\PheanstalkBundle\Service\QueueUtilities; /** * Purge a single beanstalkd tube of jobs. */ +#[AsCommand(name: 'pheanstalk:purge-queue')] final class PurgeQueueCommand extends Command { - protected static $defaultName = 'pheanstalk:purge-queue'; - public function __construct(private QueueUtilities $queueUtilities, $name=null) { parent::__construct($name); diff --git a/src/Command/StatsCommand.php b/src/Command/StatsCommand.php index 9e88b17..4a05ea3 100644 --- a/src/Command/StatsCommand.php +++ b/src/Command/StatsCommand.php @@ -12,12 +12,12 @@ namespace PMG\PheanstalkBundle\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Pheanstalk\PheanstalkInterface; use Pheanstalk\Exception\ServerException; use PMG\PheanstalkBundle\Service\StatsService; @@ -26,10 +26,9 @@ * * @since 1.0 */ +#[AsCommand(name: 'pheanstalk:stats')] final class StatsCommand extends Command { - protected static $defaultName = 'pheanstalk:stats'; - /** * @var StatsService */ diff --git a/src/DependencyInjection/PmgPheanstalkExtension.php b/src/DependencyInjection/PmgPheanstalkExtension.php index df4eded..9244666 100644 --- a/src/DependencyInjection/PmgPheanstalkExtension.php +++ b/src/DependencyInjection/PmgPheanstalkExtension.php @@ -37,7 +37,7 @@ final class PmgPheanstalkExtension extends ConfigurableExtension /** * {@inheritdoc} */ - protected function loadInternal(array $config, ContainerBuilder $container) + protected function loadInternal(array $config, ContainerBuilder $container): void { $connections = []; foreach ($config['connections'] as $name => $connConfig) {