SessionBootstrapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 24
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBindings() 0 6 1
A registerBindings() 0 8 1
1
<?php
2
3
namespace Foo\Session\Bootstrapper;
4
5
use Foo\Session\FlashService;
6
use Opulence\Ioc\Bootstrappers\Bootstrapper;
7
use Opulence\Ioc\Bootstrappers\ILazyBootstrapper;
8
use Opulence\Ioc\IContainer;
9
use Opulence\Sessions\ISession;
10
11
class SessionBootstrapper extends Bootstrapper implements ILazyBootstrapper
12
{
13
    /**
14
     * @return array
15
     */
16
    public function getBindings() : array
17
    {
18
        return [
19
            FlashService::class,
20
        ];
21
    }
22
23
    /**
24
     * @param IContainer $container
25
     */
26 1
    public function registerBindings(IContainer $container)
27
    {
28 1
        $session = $container->resolve(ISession::class);
29
30 1
        $flashService = new FlashService($session);
31
32 1
        $container->bindInstance(FlashService::class, $flashService);
33
    }
34
}