Test Failed
Push — master ( bdaab5...176ee2 )
by Vladimir
06:36
created

Factory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Foundation;
6
7
use League\Container\Container;
8
use League\Container\ReflectionContainer;
9
use FondBot\Drivers\DriverServiceProvider;
10
use FondBot\Conversation\SessionServiceProvider;
11
12
class Factory
13
{
14
    public static function create(Container $container): Kernel
15
    {
16
        $container->delegate(new ReflectionContainer);
17
18
        // Load service providers
19
        $container->addServiceProvider(new DriverServiceProvider);
20
        $container->addServiceProvider(new SessionServiceProvider);
21
22
        // Boot kernel
23
        $kernel = Kernel::createInstance($container);
24
25
        $container->add(Kernel::class, $kernel);
26
27
        return $kernel;
28
    }
29
}
30