DockerInstaller::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Dock\Installer;
4
5
use SRIO\ChainOfResponsibility\ChainRunner;
6
use SRIO\ChainOfResponsibility\DecoratorFactoryInterface;
7
8
class DockerInstaller implements Installable
9
{
10
    /**
11
     * @var TaskProvider
12
     */
13
    private $taskProvider;
14
15
    /**
16
     * @var DecoratorFactoryInterface
17
     */
18
    private $processDecoratorFactory;
19
20
    /**
21
     * @param TaskProvider              $taskProvider
22
     * @param DecoratorFactoryInterface $processDecoratorFactory
23
     */
24
    public function __construct(TaskProvider $taskProvider, DecoratorFactoryInterface $processDecoratorFactory)
25
    {
26
        $this->taskProvider = $taskProvider;
27
        $this->processDecoratorFactory = $processDecoratorFactory;
28
    }
29
30
    /**
31
     * Start the Docker installation process.
32
     */
33
    public function run()
34
    {
35
        $processes = $this->taskProvider->getChainBuilder()->getOrderedProcesses();
36
37
        $runner = new ChainRunner($processes, $this->processDecoratorFactory);
38
        $runner->run();
39
    }
40
}
41