Passed
Push — master ( b0dfbc...4d3ad3 )
by Mariano
12:04
created

Config::getFactoryClassName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Mcustiel\Phiremock\Server\Utils\Config;
4
5
use Mcustiel\Phiremock\Server\Cli\Options\ExpectationsDirectory;
6
use Mcustiel\Phiremock\Server\Cli\Options\HostInterface;
7
use Mcustiel\Phiremock\Server\Cli\Options\PhpFactoryFqcn;
8
use Mcustiel\Phiremock\Server\Cli\Options\Port;
9
10
class Config
11
{
12
    /** @var array */
13
    private $configurationArray;
14
15
    public function __construct(array $configurationArray)
16
    {
17
        $this->configurationArray = $configurationArray;
18
    }
19
20
    public function getInterfaceIp(): HostInterface
21
    {
22
        return new HostInterface($this->configurationArray['ip']);
23
    }
24
25
    public function getPort(): Port
26
    {
27
        return new Port((int) $this->configurationArray['port']);
28
    }
29
30
    public function isDebugMode(): bool
31
    {
32
        return $this->configurationArray['debug'];
33
    }
34
35
    public function getExpectationsPath(): ExpectationsDirectory
36
    {
37
        return new ExpectationsDirectory($this->configurationArray['expectations-dir']);
38
    }
39
40
    public function getFactoryClassName(): PhpFactoryFqcn
41
    {
42
        return new PhpFactoryFqcn($this->configurationArray['factory-class']);
43
    }
44
}
45