ShellCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
    /** @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