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

InstallCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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