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

SessionServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
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