Passed
Pull Request — master (#9)
by ANTHONIUS
03:03
created

ShellCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the dotfiles project.
5
 *
6
 *     (c) Anthonius Munthi <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Dotfiles\Core\Command;
13
14
use Dotfiles\Core\Console\Shell;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
/**
19
 * ShellCommand.
20
 *
21
 * @author Anthonius Munthi [email protected]
22
 */
23
class ShellCommand extends Command
24
{
25
    /**
26
     * @var Shell
27
     */
28
    private $shell;
29
30
    public function __construct(?string $name = null, Shell $shell)
31
    {
32
        parent::__construct($name);
33
        $this->shell = $shell;
34
    }
35
36
    protected function configure()
37
    {
38
        $this
39
            ->setName('shell')
40
            ->setDescription('Execute dotfiles shell')
41
        ;
42
    }
43
44
    protected function execute(InputInterface $input, OutputInterface $output)
45
    {
46
        $this->shell->run();
47
    }
48
}
49