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

InstallCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 25
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A configure() 0 5 1
A execute() 0 3 1
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\Plugins\NVM\Command;
13
14
use Dotfiles\Core\Command\Command;
15
use Dotfiles\Plugins\NVM\Installer;
16
use Symfony\Component\Console\Input\InputInterface;
17
use Symfony\Component\Console\Output\OutputInterface;
18
19
class InstallCommand extends Command
20
{
21
    /**
22
     * @var Installer
23
     */
24
    private $installer;
25
26
    public function __construct(?string $name = null, Installer $installer)
27
    {
28
        parent::__construct($name);
29
30
        $this->installer = $installer;
31
    }
32
33
    protected function configure()
34
    {
35
        $this
36
            ->setName('nvm:install')
37
            ->setDescription('Install Node Version Manager')
38
        ;
39
    }
40
41
    protected function execute(InputInterface $input, OutputInterface $output)
42
    {
43
        $this->installer->install();
44
    }
45
}
46