ShellCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 2
cbo 2
dl 0
loc 29
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 7 1
A execute() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace AlexMasterov\PsyshBundle\Command;
5
6
use Psy\Shell;
7
use Symfony\Component\Console\{
8
    Command\Command,
9
    Input\InputInterface,
10
    Output\OutputInterface
11
};
12
13
class ShellCommand extends Command
14
{
15
    /** @var Shell */
16
    private $shell;
17
18 2
    public function __construct(Shell $shell)
19
    {
20 2
        parent::__construct();
21
22 2
        $this->shell = $shell;
23 2
    }
24
25
    /** {@inheritdoc} */
26 2
    protected function configure()
27
    {
28
        $this
29 2
            ->setName('psysh:shell')
30 2
            ->setAliases(['sh'])
31 2
            ->setDescription('Run Psy Shell');
32 2
    }
33
34
    /** {@inheritdoc} */
35 1
    protected function execute(
36
        InputInterface $input,
37
        OutputInterface $output
38
    ) {
39 1
        return $this->shell->run();
40
    }
41
}
42