FeatureInstallTaskController::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
namespace PSB\Core\Feature;
3
4
5
use PSB\Core\ObjectBuilder\BuilderInterface;
6
7
class FeatureInstallTaskController
8
{
9
    /**
10
     * @var callable
11
     */
12
    private $taskFactory;
13
14
    /**
15
     * @param callable $taskFactory
16
     */
17 4
    public function __construct(callable $taskFactory)
18
    {
19 4
        $this->taskFactory = $taskFactory;
20 4
    }
21
22
    /**
23
     * @param BuilderInterface $builder
24
     */
25 2
    public function install(BuilderInterface $builder)
26
    {
27 2
        $taskFactory = $this->taskFactory;
28
        /** @var FeatureInstallTaskInterface $installTask */
29 2
        $installTask = $taskFactory($builder);
30 2
        $installTask->install();
31 2
    }
32
}
33