FeatureStartupTaskController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 27
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 start() 0 7 1
1
<?php
2
namespace PSB\Core\Feature;
3
4
5
use PSB\Core\BusContextInterface;
6
use PSB\Core\ObjectBuilder\BuilderInterface;
7
8
class FeatureStartupTaskController
9
{
10
    /**
11
     * @var callable
12
     */
13
    private $taskFactory;
14
15
    /**
16
     * @param callable $taskFactory
17
     */
18 3
    public function __construct(callable $taskFactory)
19
    {
20 3
        $this->taskFactory = $taskFactory;
21 3
    }
22
23
    /**
24
     * @param BuilderInterface    $builder
25
     * @param BusContextInterface $busContext
26
     */
27 2
    public function start(BuilderInterface $builder, BusContextInterface $busContext)
28
    {
29 2
        $taskFactory = $this->taskFactory;
30
        /** @var FeatureStartupTaskInterface $startupTask */
31 2
        $startupTask = $taskFactory($builder);
32 2
        $startupTask->start($busContext);
33 2
    }
34
}
35