Skip to content

Commit d26f091

Browse files
authored
Merge pull request #1311 from ruudk/symfony-6.3
Use `#[AsCommand]` attribute on commands
2 parents 1e68971 + 774ccdf commit d26f091

File tree

10 files changed

+22
-10
lines changed

10 files changed

+22
-10
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
1919
- uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: '7.4'
21+
php-version: '8.2'
2222
coverage: none
2323
extensions: mongodb, redis, :xdebug
2424
ini-values: memory_limit=2048M

Diff for: docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PHP_VERSION=7.4
1+
ARG PHP_VERSION=8.2
22
FROM makasim/nginx-php-fpm:${PHP_VERSION}-all-exts
33

44
ARG PHP_VERSION

Diff for: pkg/enqueue/Symfony/Client/ConsumeCommand.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@
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
{
26+
use ChooseLoggerCommandTrait;
2427
use LimitsExtensionsCommandTrait;
25-
use SetupBrokerExtensionCommandTrait;
2628
use QueueConsumerOptionsCommandTrait;
27-
use ChooseLoggerCommandTrait;
29+
use SetupBrokerExtensionCommandTrait;
2830

2931
protected static $defaultName = 'enqueue:consume';
3032

Diff for: pkg/enqueue/Symfony/Client/ProduceCommand.php

+2
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';

Diff for: pkg/enqueue/Symfony/Client/RoutesCommand.php

+2
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';

Diff for: pkg/enqueue/Symfony/Client/SetupBrokerCommand.php

+2
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';

Diff for: pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@
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
{
21+
use ChooseLoggerCommandTrait;
1922
use LimitsExtensionsCommandTrait;
2023
use QueueConsumerOptionsCommandTrait;
21-
use ChooseLoggerCommandTrait;
2224

2325
protected static $defaultName = 'enqueue:transport:consume';
2426

Diff for: pkg/enqueue/Symfony/Consumption/ConsumeCommand.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
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
{
19+
use ChooseLoggerCommandTrait;
1720
use LimitsExtensionsCommandTrait;
1821
use QueueConsumerOptionsCommandTrait;
19-
use ChooseLoggerCommandTrait;
2022

2123
protected static $defaultName = 'enqueue:transport:consume';
2224

Diff for: pkg/sns/Tests/SnsClientTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function testShouldAllowGetAwsClientIfSingleClientProvided()
1616
$awsClient = (new Sdk(['Sns' => [
1717
'key' => '',
1818
'secret' => '',
19-
'region' => '',
19+
'region' => 'us-west-2',
2020
'version' => '2010-03-31',
2121
'endpoint' => 'http://localhost',
2222
]]))->createSns();
@@ -31,7 +31,7 @@ public function testShouldAllowGetAwsClientIfMultipleClientProvided()
3131
$awsClient = (new Sdk(['Sns' => [
3232
'key' => '',
3333
'secret' => '',
34-
'region' => '',
34+
'region' => 'us-west-2',
3535
'version' => '2010-03-31',
3636
'endpoint' => 'http://localhost',
3737
]]))->createMultiRegionSns();

Diff for: pkg/sqs/Tests/SqsClientTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function testShouldAllowGetAwsClientIfSingleClientProvided()
1616
$awsClient = (new Sdk(['Sqs' => [
1717
'key' => '',
1818
'secret' => '',
19-
'region' => '',
19+
'region' => 'us-west-2',
2020
'version' => '2012-11-05',
2121
'endpoint' => 'http://localhost',
2222
]]))->createSqs();
@@ -31,7 +31,7 @@ public function testShouldAllowGetAwsClientIfMultipleClientProvided()
3131
$awsClient = (new Sdk(['Sqs' => [
3232
'key' => '',
3333
'secret' => '',
34-
'region' => '',
34+
'region' => 'us-west-2',
3535
'version' => '2012-11-05',
3636
'endpoint' => 'http://localhost',
3737
]]))->createMultiRegionSqs();

0 commit comments

Comments
 (0)