Passed
Push — master ( c656c3...4347f4 )
by n
01:51
created

BootLoader   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 21
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 boot() 0 7 2
1
<?php
2
declare(strict_types=1);
3
4
namespace N1215\Tsukuyomi;
5
6
class BootLoader implements BootLoaderInterface
7
{
8
    /** @var string[] */
9
    private $bootstrapperClasses;
10
11
    /**
12
     * @param string[] $bootstrapperClasses
13
     */
14 1
    public function __construct(array $bootstrapperClasses)
15
    {
16 1
        $this->bootstrapperClasses = $bootstrapperClasses;
17 1
    }
18
19 1
    public function boot(): void
20
    {
21 1
        foreach($this->bootstrapperClasses as $bootstrapperClass) {
22 1
            $bootstrapper = new $bootstrapperClass();
23 1
            $bootstrapper->bootstrap();
24
        }
25
    }
26
}