Skip to content

Commit dddf279

Browse files
Allow usage of symfony/console version 7 (#236)
1 parent 72885e8 commit dddf279

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"php": "^8.1",
4040
"psr/container": "^1.0|^2.0",
4141
"psr/log": "^2.0|^3.0",
42-
"symfony/console": "^5.4|^6.0",
42+
"symfony/console": "^5.4|^6.0|^7.0",
4343
"yiisoft/definitions": "^3.3.1",
4444
"yiisoft/factory": "^1.3",
4545
"yiisoft/friendly-exception": "^1.0",

src/Command/ListenAllCommand.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Yiisoft\Queue\Command;
66

7+
use Symfony\Component\Console\Attribute\AsCommand;
78
use Symfony\Component\Console\Command\Command;
89
use Symfony\Component\Console\Input\InputArgument;
910
use Symfony\Component\Console\Input\InputInterface;
@@ -12,14 +13,15 @@
1213
use Yiisoft\Queue\Cli\LoopInterface;
1314
use Yiisoft\Queue\Provider\QueueProviderInterface;
1415

16+
#[AsCommand(
17+
'queue:listen-all',
18+
'Listens the all the given queues and executes messages as they come. '
19+
. 'Meant to be used in development environment only. '
20+
. 'Listens all configured queues by default in case you\'re using yiisoft/config. '
21+
. 'Needs to be stopped manually.'
22+
)]
1523
final class ListenAllCommand extends Command
1624
{
17-
protected static $defaultName = 'queue:listen-all';
18-
protected static $defaultDescription = 'Listens the all the given queues and executes messages as they come. ' .
19-
'Meant to be used in development environment only. ' .
20-
'Listens all configured queues by default in case you\'re using yiisoft/config. ' .
21-
'Needs to be stopped manually.';
22-
2325
public function __construct(
2426
private readonly QueueProviderInterface $queueProvider,
2527
private readonly LoopInterface $loop,

src/Command/ListenCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@
44

55
namespace Yiisoft\Queue\Command;
66

7+
use Symfony\Component\Console\Attribute\AsCommand;
78
use Symfony\Component\Console\Command\Command;
89
use Symfony\Component\Console\Input\InputArgument;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Output\OutputInterface;
1112
use Yiisoft\Queue\Provider\QueueProviderInterface;
1213
use Yiisoft\Queue\QueueInterface;
1314

15+
#[AsCommand(
16+
'queue:listen',
17+
'Listens the queue and executes messages as they come. Needs to be stopped manually.'
18+
)]
1419
final class ListenCommand extends Command
1520
{
16-
protected static $defaultName = 'queue:listen';
17-
protected static $defaultDescription = 'Listens the queue and executes messages as they come. Needs to be stopped manually.';
18-
1921
public function __construct(
2022
private readonly QueueProviderInterface $queueProvider
2123
) {

src/Command/RunCommand.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44

55
namespace Yiisoft\Queue\Command;
66

7+
use Symfony\Component\Console\Attribute\AsCommand;
78
use Symfony\Component\Console\Command\Command;
89
use Symfony\Component\Console\Input\InputArgument;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Input\InputOption;
1112
use Symfony\Component\Console\Output\OutputInterface;
1213
use Yiisoft\Queue\Provider\QueueProviderInterface;
1314

15+
#[AsCommand(
16+
'queue:run',
17+
'Runs all the existing messages in the given queues. Exits once messages are over.'
18+
)]
1419
final class RunCommand extends Command
1520
{
16-
protected static $defaultName = 'queue:run';
17-
protected static $defaultDescription = 'Runs all the existing messages in the given queues. ' .
18-
'Exits once messages are over.';
19-
2021
public function __construct(
2122
private readonly QueueProviderInterface $queueProvider,
2223
private readonly array $channels,

0 commit comments

Comments
 (0)