Skip to content

Symfony add default command name #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions pkg/enqueue/Symfony/Client/ConsumeMessagesCommand.php
Original file line number Diff line number Diff line change
@@ -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. '.
5 changes: 3 additions & 2 deletions pkg/enqueue/Symfony/Client/Meta/QueuesCommand.php
Original file line number Diff line number Diff line change
@@ -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',
5 changes: 3 additions & 2 deletions pkg/enqueue/Symfony/Client/Meta/TopicsCommand.php
Original file line number Diff line number Diff line change
@@ -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',
5 changes: 3 additions & 2 deletions pkg/enqueue/Symfony/Client/ProduceMessageCommand.php
Original file line number Diff line number Diff line change
@@ -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')
5 changes: 3 additions & 2 deletions pkg/enqueue/Symfony/Client/SetupBrokerCommand.php
Original file line number Diff line number Diff line change
@@ -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')
;
5 changes: 3 additions & 2 deletions pkg/enqueue/Symfony/Consumption/ConsumeMessagesCommand.php
Original file line number Diff line number Diff line change
@@ -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')
;
Original file line number Diff line number Diff line change
@@ -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')