diff --git a/src/Command/ClearQueueCommand.php b/src/Command/ClearQueueCommand.php index d09706d..15f5a93 100644 --- a/src/Command/ClearQueueCommand.php +++ b/src/Command/ClearQueueCommand.php @@ -2,6 +2,7 @@ namespace VisualCraft\Bundle\WorkQueueBundle\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -9,6 +10,7 @@ use Symfony\Component\DependencyInjection\ServiceLocator; use VisualCraft\WorkQueue\QueueManager; +#[AsCommand(name: 'vc:work-queue:clear')] class ClearQueueCommand extends Command { protected static $defaultName = 'vc:work-queue:clear'; @@ -33,7 +35,7 @@ protected function configure() ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $queues = array_unique($input->getArgument('queues')); diff --git a/src/Command/RunProcessorCommand.php b/src/Command/RunProcessorCommand.php index bb6f911..5b07b52 100644 --- a/src/Command/RunProcessorCommand.php +++ b/src/Command/RunProcessorCommand.php @@ -2,12 +2,14 @@ namespace VisualCraft\Bundle\WorkQueueBundle\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\ServiceLocator; +#[AsCommand(name: 'vc:work-queue:run')] class RunProcessorCommand extends Command { protected static $defaultName = 'vc:work-queue:run'; @@ -28,7 +30,7 @@ protected function configure() ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $queue = $input->getArgument('queue'); diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index ae73ab0..97c705c 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -7,7 +7,7 @@ class Configuration implements ConfigurationInterface { - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('visual_craft_work_queue'); $treeBuilder->getRootNode()