FeatureStarter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 28
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A startFeatures() 0 8 3
1
<?php
2
3
namespace PSB\Core\Feature;
4
5
use PSB\Core\BusContextInterface;
6
use PSB\Core\ObjectBuilder\BuilderInterface;
7
8
class FeatureStarter
9
{
10
    /**
11
     * @var Feature[]
12
     */
13
    private $features;
14
15
    /**
16
     * @param Feature[] $features
17
     */
18 2
    public function __construct(array $features)
19
    {
20 2
        $this->features = $features;
21 2
    }
22
23
    /**
24
     * @param BuilderInterface    $builder
25
     * @param BusContextInterface $busContext
26
     */
27 1
    public function startFeatures(BuilderInterface $builder, BusContextInterface $busContext)
28
    {
29 1
        foreach ($this->features as $feature) {
30 1
            if ($feature->isActive()) {
31 1
                $feature->start($builder, $busContext);
32
            }
33
        }
34 1
    }
35
}
36