8000 Define command description as static property · tucksaun/SwarrotBundle@510e0c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 510e0c5

Browse files
committed
Define command description as static property
This allow Symfony to make the command lazy-loadable and thus avoiding instantiation of every processor just to list applications command. See symfony/symfony#39851 for more info
1 parent 0a80605 commit 510e0c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Command/SwarrotCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class SwarrotCommand extends Command
3333
/** @var array */
3434
protected $aliases;
3535

36+
/** @var string */
37+
protected static $defaultDescription = 'Consume messages from a given queue';
38+
3639
public function __construct(
3740
FactoryInterface $swarrotFactory,
3841
string $name,
@@ -65,7 +68,7 @@ protected function configure(): void
6568
$this
6669
->setName('swarrot:consume:'.$this->name)
6770
->setAliases($this->aliases)
68-
->setDescription('Consume messages from a given queue')
71+
->setDescription(self::$defaultDescription)
6972
->addArgument('queue', InputArgument::OPTIONAL, 'Queue to consume', $this->queue)
7073
->addArgument('connection', InputArgument::OPTIONAL, 'Connection to use', $this->connectionName)
7174
->addOption(

0 commit comments

Comments
 (0)
0