ControlCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
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