DockerCompose::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexus\DockerClient\Business\Model;
5
6
7
use Nexus\Shell\Business\ShellFacade;
8
9
class DockerCompose implements DockerComposeInterface
10
{
11
    /**
12
     * @var \Nexus\Shell\Business\ShellFacade
13
     */
14
    private $shellFacade;
15
16
    /**
17
     * @var string
18
     */
19
    private $command;
20
21
    /**
22
     * DockerCompose constructor.
23
     *
24
     * @param \Nexus\Shell\Business\ShellFacade $shellFacade
25
     * @param string $command
26
     */
27
    public function __construct(ShellFacade $shellFacade, string $command)
28
    {
29
        $this->shellFacade = $shellFacade;
30
        $this->command = $command;
31
    }
32
33
34
    /**
35
     * @param string $command
36
     *
37
     * @return string
38
     */
39
    public function execute(string $command): string
40
    {
41
        return $this->shellFacade->runCommand($this->command . ' ' . $command);
42
    }
43
}