Docker   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 33
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 3 1
A __construct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexus\DockerClient\Business\Model;
5
6
use Nexus\Shell\Business\ShellFacade;
7
8
class Docker implements DockerInterface
9
{
10
    /**
11
     * @var \Nexus\Shell\Business\ShellFacade
12
     */
13
    private $shellFacade;
14
15
    /**
16
     * @var string
17
     */
18
    private $command;
19
20
    /**
21
     * Docker constructor.
22
     *
23
     * @param \Nexus\Shell\Business\ShellFacade $shellFacade
24
     * @param string $command
25
     */
26
    public function __construct(ShellFacade $shellFacade, string $command)
27
    {
28
        $this->shellFacade = $shellFacade;
29
        $this->command = $command;
30
    }
31
32
33
    /**
34
     * @param string $command
35
     *
36
     * @return string
37
     */
38
    public function execute(string $command): string
39
    {
40
        return $this->shellFacade->runCommand($this->command . ' ' . $command);
41
    }
42
}