diff --git a/phpstan.neon b/phpstan.neon index 7708cf562..1a51a46e1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,9 @@ parameters: excludes_analyse: - - bin/pre-commit + - docs + - bin + - docker + - var - pkg/amqp-lib/tutorial - pkg/enqueue-bundle/Tests/Functional/App/AsyncListener.php - pkg/enqueue/Util/UUID.php diff --git a/pkg/enqueue/Symfony/Client/ConsumeMessagesCommand.php b/pkg/enqueue/Symfony/Client/ConsumeMessagesCommand.php index a3817b3e5..c28bfe563 100644 --- a/pkg/enqueue/Symfony/Client/ConsumeMessagesCommand.php +++ b/pkg/enqueue/Symfony/Client/ConsumeMessagesCommand.php @@ -24,6 +24,8 @@ class ConsumeMessagesCommand extends Command use SetupBrokerExtensionCommandTrait; use QueueConsumerOptionsCommandTrait; + protected static $defaultName = 'enqueue:consume'; + /** * @var QueueConsumer */ @@ -56,7 +58,7 @@ public function __construct( QueueMetaRegistry $queueMetaRegistry, DriverInterface $driver ) { - parent::__construct(null); + parent::__construct(static::$defaultName); $this->consumer = $consumer; $this->processor = $processor; @@ -74,7 +76,6 @@ protected function configure() $this->configureQueueConsumerOptions(); $this - ->setName('enqueue:consume') ->setAliases(['enq:c']) ->setDescription('A client\'s worker that processes messages. '. 'By default it connects to default queue. '. diff --git a/pkg/enqueue/Symfony/Client/Meta/QueuesCommand.php b/pkg/enqueue/Symfony/Client/Meta/QueuesCommand.php index 02d263d2b..12c459dce 100644 --- a/pkg/enqueue/Symfony/Client/Meta/QueuesCommand.php +++ b/pkg/enqueue/Symfony/Client/Meta/QueuesCommand.php @@ -11,6 +11,8 @@ class QueuesCommand extends Command { + protected static $defaultName = 'enqueue:queues'; + /** * @var QueueMetaRegistry */ @@ -21,7 +23,7 @@ class QueuesCommand extends Command */ public function __construct(QueueMetaRegistry $queueRegistry) { - parent::__construct(null); + parent::__construct(static::$defaultName); $this->queueMetaRegistry = $queueRegistry; } @@ -32,7 +34,6 @@ public function __construct(QueueMetaRegistry $queueRegistry) protected function configure() { $this - ->setName('enqueue:queues') ->setAliases([ 'enq:m:q', 'debug:enqueue:queues', diff --git a/pkg/enqueue/Symfony/Client/Meta/TopicsCommand.php b/pkg/enqueue/Symfony/Client/Meta/TopicsCommand.php index 8314fb99a..63b28bc14 100644 --- a/pkg/enqueue/Symfony/Client/Meta/TopicsCommand.php +++ b/pkg/enqueue/Symfony/Client/Meta/TopicsCommand.php @@ -11,6 +11,8 @@ class TopicsCommand extends Command { + protected static $defaultName = 'enqueue:topics'; + /** * @var TopicMetaRegistry */ @@ -21,7 +23,7 @@ class TopicsCommand extends Command */ public function __construct(TopicMetaRegistry $topicRegistry) { - parent::__construct(null); + parent::__construct(static::$defaultName); $this->topicRegistry = $topicRegistry; } @@ -32,7 +34,6 @@ public function __construct(TopicMetaRegistry $topicRegistry) protected function configure() { $this - ->setName('enqueue:topics') ->setAliases([ 'enq:m:t', 'debug:enqueue:topics', diff --git a/pkg/enqueue/Symfony/Client/ProduceMessageCommand.php b/pkg/enqueue/Symfony/Client/ProduceMessageCommand.php index a9f9ef90a..5e83903ca 100644 --- a/pkg/enqueue/Symfony/Client/ProduceMessageCommand.php +++ b/pkg/enqueue/Symfony/Client/ProduceMessageCommand.php @@ -10,6 +10,8 @@ class ProduceMessageCommand extends Command { + protected static $defaultName = 'enqueue:produce'; + /** * @var ProducerInterface */ @@ -20,7 +22,7 @@ class ProduceMessageCommand extends Command */ public function __construct(ProducerInterface $producer) { - parent::__construct(null); + parent::__construct(static::$defaultName); $this->producer = $producer; } @@ -31,7 +33,6 @@ public function __construct(ProducerInterface $producer) protected function configure() { $this - ->setName('enqueue:produce') ->setAliases(['enq:p']) ->setDescription('A command to send a message to topic') ->addArgument('topic', InputArgument::REQUIRED, 'A topic to send message to') diff --git a/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php b/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php index c825bd2c4..9bd8ee67e 100644 --- a/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php +++ b/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php @@ -10,6 +10,8 @@ class SetupBrokerCommand extends Command { + protected static $defaultName = 'enqueue:setup-broker'; + /** * @var DriverInterface */ @@ -20,7 +22,7 @@ class SetupBrokerCommand extends Command */ public function __construct(DriverInterface $driver) { - parent::__construct(null); + parent::__construct(static::$defaultName); $this->driver = $driver; } @@ -31,7 +33,6 @@ public function __construct(DriverInterface $driver) protected function configure() { $this - ->setName('enqueue:setup-broker') ->setAliases(['enq:sb']) ->setDescription('Creates all required queues') ; diff --git a/pkg/enqueue/Symfony/Consumption/ConsumeMessagesCommand.php b/pkg/enqueue/Symfony/Consumption/ConsumeMessagesCommand.php index c2c7695f1..0f6b54dcc 100644 --- a/pkg/enqueue/Symfony/Consumption/ConsumeMessagesCommand.php +++ b/pkg/enqueue/Symfony/Consumption/ConsumeMessagesCommand.php @@ -18,6 +18,8 @@ class ConsumeMessagesCommand extends Command implements ContainerAwareInterface use LimitsExtensionsCommandTrait; use QueueConsumerOptionsCommandTrait; + protected static $defaultName = 'enqueue:transport:consume'; + /** * @var QueueConsumer */ @@ -28,7 +30,7 @@ class ConsumeMessagesCommand extends Command implements ContainerAwareInterface */ public function __construct(QueueConsumer $consumer) { - parent::__construct(null); + parent::__construct(static::$defaultName); $this->consumer = $consumer; } @@ -42,7 +44,6 @@ protected function configure() $this->configureQueueConsumerOptions(); $this - ->setName('enqueue:transport:consume') ->setDescription('A worker that consumes message from a broker. '. 'To use this broker you have to configure queue consumer before adding to the command') ; diff --git a/pkg/enqueue/Symfony/Consumption/ContainerAwareConsumeMessagesCommand.php b/pkg/enqueue/Symfony/Consumption/ContainerAwareConsumeMessagesCommand.php index 297dfa58d..6475ee21b 100644 --- a/pkg/enqueue/Symfony/Consumption/ContainerAwareConsumeMessagesCommand.php +++ b/pkg/enqueue/Symfony/Consumption/ContainerAwareConsumeMessagesCommand.php @@ -22,6 +22,8 @@ class ContainerAwareConsumeMessagesCommand extends Command implements ContainerA use LimitsExtensionsCommandTrait; use QueueConsumerOptionsCommandTrait; + protected static $defaultName = 'enqueue:transport:consume'; + /** * @var QueueConsumer */ @@ -34,7 +36,7 @@ class ContainerAwareConsumeMessagesCommand extends Command implements ContainerA */ public function __construct(QueueConsumer $consumer) { - parent::__construct(null); + parent::__construct(static::$defaultName); $this->consumer = $consumer; } @@ -48,7 +50,6 @@ protected function configure() $this->configureQueueConsumerOptions(); $this - ->setName('enqueue:transport:consume') ->setDescription('A worker that consumes message from a broker. '. 'To use this broker you have to explicitly set a queue to consume from '. 'and a message processor service')