Completed
Push — master ( 030b5f...d05431 )
by Vladimir
02:51
created

SessionServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 9
ccs 6
cts 6
cp 1
crap 1
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation;
6
7
use FondBot\Contracts\Cache;
8
use League\Container\ServiceProvider\AbstractServiceProvider;
9
10
class SessionServiceProvider extends AbstractServiceProvider
11
{
12
    protected $provides = [
13
        SessionManager::class,
14
    ];
15
16
    /**
17
     * Use the register method to register items with the container via the
18
     * protected $this->container property or the `getContainer` method
19
     * from the ContainerAwareTrait.
20
     *
21
     * @return void
22
     * @throws \Psr\Container\ContainerExceptionInterface
23
     */
24
    public function register(): void
25
    {
26 1
        $this->container->share(SessionManager::class, function () {
27 1
            return new SessionManager(
28 1
                $this->container,
29 1
                $this->container->get(Cache::class)
30
            );
31 1
        });
32 1
    }
33
}
34