DockerClientBusinessFactory   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 9
dl 0
loc 38
ccs 0
cts 21
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A createDocker() 0 5 1
A getCommandList() 0 3 1
A getShellFacade() 0 3 1
A createDockerCompose() 0 5 1
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
}