ConfigurationStep   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 45
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A __construct() 0 6 1
A getChildren() 0 3 1
A getService() 0 3 1
A getOptions() 0 3 1
A isEnabled() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Darkilliant\ProcessBundle\Configuration;
6
7
class ConfigurationStep
8
{
9
    /** @var array */
10
    private $children;
11
12
    /** @var array */
13
    private $options;
14
15
    /** @var string */
16
    private $service;
17
18
    /** @var bool */
19
    private $enabled;
20
21 10
    private function __construct(string $service, array $options, array $children, bool $enabled = true)
22
    {
23 10
        $this->service = $service;
24 10
        $this->options = $options;
25 10
        $this->children = array_map([ConfigurationStep::class, 'create'], $children);
26 10
        $this->enabled = $enabled;
27 10
    }
28
29 10
    public static function create(array $config)
30
    {
31 10
        return new self($config['service'], $config['options'] ?? [], $config['children'] ?? [], $config['enabled'] ?? true);
32
    }
33
34 8
    public function getOptions(): array
35
    {
36 8
        return $this->options;
37
    }
38
39 8
    public function getService(): string
40
    {
41 8
        return $this->service;
42
    }
43
44 5
    public function getChildren(): array
45
    {
46 5
        return $this->children;
47
    }
48
49 8
    public function isEnabled()
50
    {
51 8
        return $this->enabled;
52
    }
53
}
54