Completed
Push — master ( 1389b9...87a6d2 )
by Alex
01:43
created

ShellCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
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 35
ccs 12
cts 12
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 2
    public function __construct(Shell $shell)
16
    {
17 2
        parent::__construct();
18
19 2
        $this->shell = $shell;
20 2
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 2
    protected function configure()
26
    {
27
        $this
28 2
            ->setName('psysh:shell')
29 2
            ->setAliases(['sh'])
30 2
            ->setDescription('Run Psy Shell');
31 2
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 1
    protected function execute(
37
        InputInterface $input,
38
        OutputInterface $output
39
    ) {
40 1
        $this->shell->run();
41 1
    }
42
43
    /**
44
     * @var Shell
45
     */
46
    private $shell;
47
}
48