Failed Conditions
Pull Request — 0.4 (#40)
by jean
05:17
created

ConfigurationProcess::getDeprecated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Darkilliant\ProcessBundle\Configuration;
4
5
class ConfigurationProcess
6
{
7
    /** @var ConfigurationStep[] */
8
    private $steps;
9
10
    private $logger;
11
12
    /** @var array */
13
    private $deprecated;
14
15
    /** @var string */
16
    private $name;
17
18 11
    private function __construct(string $name, string $logger, array $steps, array $deprecated)
19
    {
20 11
        $this->name = $name;
21 11
        $this->logger = $logger;
22 11
        $this->steps = $steps;
23 11
        $this->deprecated = $deprecated;
24 11
    }
25
26 11
    public static function create(string $name, array $config): ConfigurationProcess
27
    {
28 11
        return new self(
29 11
            $name,
30 11
            $config['logger'] ?? 'process_logger_default',
31 11
            array_map([ConfigurationStep::class, 'create'], $config['steps']),
32 11
            $config['deprecated'] ?? []
33
        );
34
    }
35
36 8
    public function getSteps(): array
37
    {
38 8
        return $this->steps;
39
    }
40
41 8
    public function getLogger(): string
42
    {
43 8
        return $this->logger;
44
    }
45
46 8
    public function getDeprecated(): array
47
    {
48 8
        return $this->deprecated;
49
    }
50
51 8
    public function getName(): string
52
    {
53 8
        return $this->name;
54
    }
55
}
56