Docker::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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