Completed
Push — master ( 38098f...62d62f )
by Danny
06:00
created

StartCommand::execute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
crap 2
1
<?php
2
3
namespace MyOnlineStore\Bundle\RabbitMqManagerBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Input\InputOption;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class StartCommand extends ContainerAwareCommand
11
{
12
    /**
13
     * @inheritdoc
14
     */
15 2
    protected function configure()
16
    {
17 2
        $this
18 2
            ->setName('rabbitmq-manager:start')
19 2
            ->setDescription('start supervisord')
20 2
            ->addOption('generate', null, InputOption::VALUE_NONE, 'Generate configuration files before starting')
21
        ;
22 2
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27 2
    protected function execute(InputInterface $input, OutputInterface $output)
28
    {
29 2
        $handler = $this->getContainer()->get('phobetor_rabbitmq_supervisor');
30
31 2
        if ($input->getOption('generate')) {
32 1
            $handler->generate();
33 1
        }
34
35 2
        $handler->start();
36 2
    }
37
}
38