ControlCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 6 1
1
<?php
2
3
namespace Ivan1986\SupervisorBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class ControlCommand extends ContainerAwareCommand
11
{
12
    protected function configure()
13
    {
14
        $this
15
            ->setName('supervisor:control')
16
            ->addArgument('cmd', InputArgument::IS_ARRAY, 'supervisorCtl command')
17
            ->setDescription('execute supervisorCtl command')
18
        ;
19
    }
20
21
    protected function execute(InputInterface $input, OutputInterface $output)
22
    {
23
        $result = $this->getContainer()->get('ivan1986_supervisor.supervisor_service')
24
            ->execute(join(' ', $input->getArgument('cmd')));
25
        echo $result->getOutput();
26
    }
27
}
28