Completed
Push — 0.3 ( d1608f...20f47d )
by jean
10s
created

ConfigurationProcess   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 39
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getSteps() 0 3 1
A getDeprecated() 0 3 1
A create() 0 6 1
A __construct() 0 5 1
A getLogger() 0 3 1
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 10
    private function __construct(string $logger, array $steps, array $deprecated)
16
    {
17 10
        $this->logger = $logger;
18 10
        $this->steps = $steps;
19 10
        $this->deprecated = $deprecated;
20 10
    }
21
22 10
    public static function create(array $config): ConfigurationProcess
23
    {
24 10
        return new self(
25 10
            $config['logger'] ?? 'process_logger_default',
26 10
            array_map([ConfigurationStep::class, 'create'], $config['steps']),
27 10
            $config['deprecated'] ?? []
28
        );
29
    }
30
31 7
    public function getSteps(): array
32
    {
33 7
        return $this->steps;
34
    }
35
36 7
    public function getLogger(): string
37
    {
38 7
        return $this->logger;
39
    }
40
41 7
    public function getDeprecated(): array
42
    {
43 7
        return $this->deprecated;
44
    }
45
}
46