DockerEnvironmentInstaller::install()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 2
rs 10
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