Passed
Push — master ( 4347f4...650833 )
by n
01:44
created

BootLoaderServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
1
<?php
2
declare(strict_types=1);
3
4
namespace N1215\Tsukuyomi\Providers;
5
6
use Illuminate\Container\Container;
7
use N1215\Tsukuyomi\BootLoader;
8
use N1215\Tsukuyomi\BootLoaderInterface;
9
use N1215\Tsukuyomi\FrameworkInterface;
10
11
class BootLoaderServiceProvider
12
{
13
    public function register(Container $container)
14
    {
15 1
        $container->singleton(BootLoaderInterface::class, function (Container $container) {
16
            /** @var FrameworkInterface $framework */
17 1
            $framework = $container->get(FrameworkInterface::class);
18 1
            $bootstrapConfigPath = $framework->path('config/bootstrappers.php');
19 1
            $bootstrapperClasses = require $bootstrapConfigPath;
20 1
            return new BootLoader($bootstrapperClasses);
21 1
        });
22 1
    }
23
}
24