Completed
Push — master ( 95a54c...7178fa )
by Samuel
10:58
created

InstallCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 43
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 7 1
A execute() 0 11 1
1
<?php
2
3
namespace Dock\Cli\Docker;
4
5
use Dock\Installer\DockerInstaller;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class InstallCommand extends Command
11
{
12
    /**
13
     * @var DockerInstaller
14
     */
15
    private $dockerInstaller;
16
17
    /**
18
     * @param DockerInstaller $dockerInstaller
19
     */
20
    public function __construct(DockerInstaller $dockerInstaller)
21
    {
22
        parent::__construct();
23
24
        $this->dockerInstaller = $dockerInstaller;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function configure()
31
    {
32
        $this
33
            ->setName('docker:install')
34
            ->setDescription('Install Docker')
35
        ;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    protected function execute(InputInterface $input, OutputInterface $output)
42
    {
43
        $this->dockerInstaller->run();
44
45
        $output->writeln([
46
            '',
47
            '    The installation looks to be successful.',
48
            '    You may need to <comment>RESTART YOUR SHELL</comment> to refresh the environment variables.',
49
            '',
50
        ]);
51
    }
52
}
53