Passed
Branch 1.0.x (7d3940)
by Koldo
02:45
created

DockerEnvironmentInstaller   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A install() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\Installer\ApplicationType;
6
7
use Antidot\Installer\Question\UserWantsDocker;
8
use Antidot\Installer\Template\Docker\FileStructure;
9
use Antidot\Installer\Template\FileStructureFactory;
10
use Composer\IO\IOInterface;
11
12
class DockerEnvironmentInstaller implements App
13
{
14
    private UserWantsDocker $userWantsDockerQuestion;
15
    private FileStructureFactory $fileStructure;
16
17 3
    public function __construct(IOInterface $io)
18
    {
19 3
        $this->userWantsDockerQuestion = new UserWantsDocker($io);
20 3
        $this->fileStructure = new FileStructure();
21 3
    }
22
23 2
    public function install(string $installationPath): void
24
    {
25 2
        $userWantsDocker = $this->userWantsDockerQuestion->ask();
26 2
        if (false === $userWantsDocker) {
27 1
            return;
28
        }
29
30 1
        $this->fileStructure->create($installationPath);
31 1
    }
32
}
33