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

ShellCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 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