Completed
Pull Request — 0.4 (#40)
by jean
11:41
created

ConfigurationProcess::getName()   A

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
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
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 11
    /** @var string */
16
    private $name;
17 11
18 11
    private function __construct(string $name, string $logger, array $steps, array $deprecated)
19 11
    {
20 11
        $this->name = $name;
21
        $this->logger = $logger;
22 11
        $this->steps = $steps;
23
        $this->deprecated = $deprecated;
24 11
    }
25 11
26 11
    public static function create(string $name, array $config): ConfigurationProcess
27 11
    {
28
        return new self(
29
            $name,
30
            $config['logger'] ?? 'process_logger_default',
31 8
            array_map([ConfigurationStep::class, 'create'], $config['steps']),
32
            $config['deprecated'] ?? []
33 8
        );
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
    public function getDeprecated(): array
47
    {
48
        return $this->deprecated;
49
    }
50
51
    public function getName(): string
52
    {
53
        return $this->name;
54
    }
55
}
56