Skip to content

Commit 884f508

Browse files
committed
Use #[AsCommand] attribute on commands
Fixes the following deprecations: ```json { "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Consumption\\ConfigurableConsumeCommand\" class instead.", "count": 1 }, { "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\ConsumeCommand\" class instead.", "count": 1 }, { "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\ProduceCommand\" class instead.", "count": 1 }, { "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\SetupBrokerCommand\" class instead.", "count": 1 }, { "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\RoutesCommand\" class instead.", "count": 1 }, ```
1 parent 85a6bec commit 884f508

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

pkg/enqueue/Symfony/Client/ConsumeCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
use Interop\Queue\Processor;
1414
use Psr\Container\ContainerInterface;
1515
use Psr\Container\NotFoundExceptionInterface;
16+
use Symfony\Component\Console\Attribute\AsCommand;
1617
use Symfony\Component\Console\Command\Command;
1718
use Symfony\Component\Console\Input\InputArgument;
1819
use Symfony\Component\Console\Input\InputInterface;
1920
use Symfony\Component\Console\Input\InputOption;
2021
use Symfony\Component\Console\Output\OutputInterface;
2122

23+
#[AsCommand('enqueue:consume')]
2224
class ConsumeCommand extends Command
2325
{
2426
use LimitsExtensionsCommandTrait;

pkg/enqueue/Symfony/Client/ProduceCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
use Enqueue\Client\ProducerInterface;
77
use Psr\Container\ContainerInterface;
88
use Psr\Container\NotFoundExceptionInterface;
9+
use Symfony\Component\Console\Attribute\AsCommand;
910
use Symfony\Component\Console\Command\Command;
1011
use Symfony\Component\Console\Input\InputArgument;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Input\InputOption;
1314
use Symfony\Component\Console\Output\OutputInterface;
1415

16+
#[AsCommand('enqueue:produce')]
1517
class ProduceCommand extends Command
1618
{
1719
protected static $defaultName = 'enqueue:produce';

pkg/enqueue/Symfony/Client/RoutesCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
use Enqueue\Client\Route;
77
use Psr\Container\ContainerInterface;
88
use Psr\Container\NotFoundExceptionInterface;
9+
use Symfony\Component\Console\Attribute\AsCommand;
910
use Symfony\Component\Console\Command\Command;
1011
use Symfony\Component\Console\Helper\Table;
1112
use Symfony\Component\Console\Helper\TableSeparator;
1213
use Symfony\Component\Console\Input\InputInterface;
1314
use Symfony\Component\Console\Input\InputOption;
1415
use Symfony\Component\Console\Output\OutputInterface;
1516

17+
#[AsCommand('enqueue:routes')]
1618
class RoutesCommand extends Command
1719
{
1820
protected static $defaultName = 'enqueue:routes';

pkg/enqueue/Symfony/Client/SetupBrokerCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
use Enqueue\Client\DriverInterface;
66
use Psr\Container\ContainerInterface;
77
use Psr\Container\NotFoundExceptionInterface;
8+
use Symfony\Component\Console\Attribute\AsCommand;
89
use Symfony\Component\Console\Command\Command;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Input\InputOption;
1112
use Symfony\Component\Console\Logger\ConsoleLogger;
1213
use Symfony\Component\Console\Output\OutputInterface;
1314

15+
#[AsCommand('enqueue:setup-broker')]
1416
class SetupBrokerCommand extends Command
1517
{
1618
protected static $defaultName = 'enqueue:setup-broker';

pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
use Enqueue\ProcessorRegistryInterface;
99
use Psr\Container\ContainerInterface;
1010
use Psr\Container\NotFoundExceptionInterface;
11+
use Symfony\Component\Console\Attribute\AsCommand;
1112
use Symfony\Component\Console\Command\Command;
1213
use Symfony\Component\Console\Input\InputArgument;
1314
use Symfony\Component\Console\Input\InputInterface;
1415
use Symfony\Component\Console\Input\InputOption;
1516
use Symfony\Component\Console\Output\OutputInterface;
1617

18+
#[AsCommand('enqueue:transport:consume')]
1719
class ConfigurableConsumeCommand extends Command
1820
{
1921
use LimitsExtensionsCommandTrait;

pkg/enqueue/Symfony/Consumption/ConsumeCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
use Enqueue\Consumption\QueueConsumerInterface;
88
use Psr\Container\ContainerInterface;
99
use Psr\Container\NotFoundExceptionInterface;
10+
use Symfony\Component\Console\Attribute\AsCommand;
1011
use Symfony\Component\Console\Command\Command;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Input\InputOption;
1314
use Symfony\Component\Console\Output\OutputInterface;
1415

16+
#[AsCommand('enqueue:transport:consume')]
1517
class ConsumeCommand extends Command
1618
{
1719
use LimitsExtensionsCommandTrait;

0 commit comments

Comments
 (0)