Machine   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A dependsOn() 0 4 1
A getName() 0 4 1
A __construct() 0 5 1
A run() 0 6 2
1
<?php
2
3
namespace Dock\Installer\System\Mac;
4
5
use Dock\Installer\InstallerTask;
6
use Dock\IO\UserInteraction;
7
use SRIO\ChainOfResponsibility\DependentChainProcessInterface;
8
9
class Machine extends InstallerTask implements DependentChainProcessInterface
10
{
11
    /**
12
     * @var UserInteraction
13
     */
14
    private $userInteraction;
15
    /**
16
     * @var \Dock\Docker\Machine\Machine
17
     */
18
    private $machine;
19
20
    /**
21
     * @param UserInteraction              $userInteraction
22
     * @param \Dock\Docker\Machine\Machine $machine
23
     */
24
    public function __construct(UserInteraction $userInteraction, \Dock\Docker\Machine\Machine $machine)
25
    {
26
        $this->userInteraction = $userInteraction;
27
        $this->machine = $machine;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function run()
34
    {
35
        if (!$this->machine->isCreated()) {
36
            $this->machine->create();
37
        }
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function dependsOn()
44
    {
45
        return ['dockerMachine'];
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function getName()
52
    {
53
        return 'machine';
54
    }
55
}
56