WebBootstrap   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 20
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 16 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/boot project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Boot\Bootstrap;
10
11
use Auryn\Injector;
12
use Daikon\Boot\Service\ServiceProvisioner;
13
use Daikon\Config\ConfigProvider;
14
use Daikon\Config\ConfigProviderInterface;
15
use Psr\Container\ContainerInterface;
16
17
final class WebBootstrap implements BootstrapInterface
18
{
19
    use BootstrapTrait;
20
21
    public function __invoke(Injector $injector, array $bootParams): ContainerInterface
22
    {
23
        $configProvider = $this->loadConfiguration($bootParams);
24
25
        $injector
26
            ->share($injector)
27
            ->share($configProvider)
28
            ->alias(ConfigProviderInterface::class, ConfigProvider::class);
29
30
        $container = (new ServiceProvisioner)->provision($injector, $configProvider);
31
32
        $injector
33
            ->share($container)
34
            ->alias(ContainerInterface::class, get_class($container));
35
36
        return $container;
37
    }
38
}
39