DockerClientBusinessFactory::createDockerCompose()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
4
namespace Nexus\DockerClient\Business;
5
6
7
use Nexus\DockerClient\Business\Model\Docker;
8
use Nexus\DockerClient\Business\Model\DockerCompose;
9
use Nexus\DockerClient\Business\Model\DockerComposeInterface;
10
use Nexus\DockerClient\Business\Model\DockerInterface;
11
use Nexus\DockerClient\DockerClientDependencyProvider;
12
use Nexus\Shell\Business\ShellFacade;
13
use Xervice\Core\Business\Model\Factory\AbstractBusinessFactory;
14
15
/**
16
 * @method \Nexus\DockerClient\DockerClientConfig getConfig()
17
 */
18
class DockerClientBusinessFactory extends AbstractBusinessFactory
19
{
20
    /**
21
     * @return \Nexus\DockerClient\Business\Model\DockerCompose
22
     */
23
    public function createDockerCompose(): DockerComposeInterface
24
    {
25
        return new DockerCompose(
26
            $this->getShellFacade(),
27
            $this->getConfig()->getDockerComposeCommand()
28
        );
29
    }
30
31
    /**
32
     * @return \Nexus\DockerClient\Business\Model\Docker
33
     */
34
    public function createDocker(): DockerInterface
35
    {
36
        return new Docker(
37
            $this->getShellFacade(),
38
            $this->getConfig()->getDockerCommand()
39
        );
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function getCommandList(): array
46
    {
47
        return $this->getDependency(DockerClientDependencyProvider::COMMAND_LIST);
48
    }
49
50
    /**
51
     * @return \Nexus\Shell\Business\ShellFacade
52
     */
53
    public function getShellFacade(): ShellFacade
54
    {
55
        return $this->getDependency(DockerClientDependencyProvider::SHELL_FACADE);
56
    }
57
}