Skip to content

Commit 7a43c41

Browse files
committed
Define command description as static property
This allows Symfony to make the command lazy-loadable and thus avoiding instantiation of every processors only to list application's commands. See symfony/symfony#39851 for more info
1 parent 0a80605 commit 7a43c41

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy