Skip to content

Commit 6bc6336

Browse files
committed
Refactor commands
1 parent efcb552 commit 6bc6336

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"composer/installers": "~1",
3737
"php-amqplib/php-amqplib": "^2.12.1 || ^3",
3838
"psr/log": "^1.1.3",
39-
"proklung/bitrix-containerable-boilerplate": "^1.0",
39+
"proklung/bitrix-containerable-boilerplate": "^1.1",
4040
"proklung/bitrix.module.boilerplate": "^1.0",
4141
"ext-json": "*"
4242
},

lib/Command/ConsumerCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
namespace Proklung\RabbitMq\Command;
44

5+
/**
6+
* Class ConsumerCommand
7+
* @package Proklung\RabbitMq\Command
8+
*/
59
class ConsumerCommand extends BaseConsumerCommand
610
{
711
protected function configure()

lib/Command/DeleteCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function configure()
2626
* @param InputInterface $input
2727
* @param OutputInterface $output
2828
*
29-
* @return void
29+
* @return integer
3030
*/
3131
protected function execute(InputInterface $input, OutputInterface $output)
3232
{
@@ -44,12 +44,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
4444
if (!$this->getHelper('question')->ask($input, $output, $question)) {
4545
$output->writeln('<error>Deletion cancelled!</error>');
4646

47-
return;
47+
return 1;
4848
}
4949
}
5050

5151
$this->consumer = $this->getContainer()
5252
->get(sprintf($this->getConsumerService(), $input->getArgument('name')));
5353
$this->consumer->delete();
54+
55+
return 0;
5456
}
5557
}

lib/Command/PurgeConsumerCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function configure()
2626
* @param InputInterface $input
2727
* @param OutputInterface $output
2828
*
29-
* @return void
29+
* @return integer
3030
*/
3131
protected function execute(InputInterface $input, OutputInterface $output)
3232
{
@@ -44,12 +44,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
4444
if (!$this->getHelper('question')->ask($input, $output, $question)) {
4545
$output->writeln('<error>Purging cancelled!</error>');
4646

47-
return;
47+
return 1;
4848
}
4949
}
5050

5151
$this->consumer = $this->getContainer()
5252
->get(sprintf($this->getConsumerService(), $input->getArgument('name')));
5353
$this->consumer->purge($input->getArgument('name'));
54+
55+
return 0;
5456
}
5557
}

lib/Command/SetupFabricCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
class SetupFabricCommand extends BaseRabbitMqCommand
1111
{
12+
/**
13+
* @inheritdoc
14+
*/
1215
protected function configure()
1316
{
1417
$this
@@ -18,6 +21,9 @@ protected function configure()
1821
;
1922
}
2023

24+
/**
25+
* @inheritdoc
26+
*/
2127
protected function execute(InputInterface $input, OutputInterface $output)
2228
{
2329
if (defined('AMQP_DEBUG') === false) {
@@ -37,5 +43,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
3743
}
3844
}
3945

46+
return 0;
4047
}
4148
}

lib/Command/StdInProducerCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
use Symfony\Component\Console\Input\InputInterface;
88
use Symfony\Component\Console\Output\OutputInterface;
99

10+
/**
11+
* Class StdInProducerCommand
12+
* @package Proklung\RabbitMq\Command
13+
*/
1014
class StdInProducerCommand extends BaseRabbitMqCommand
1115
{
1216
const FORMAT_PHP = 'php';

0 commit comments

Comments
 (0)