SessionBootstrapper::getBindings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 2
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
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
}