Completed
Push — master ( da1cfa...dccc7f )
by Vladimir
03:06
created

ContextServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

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 ContextServiceProvider extends AbstractServiceProvider
11
{
12
    protected $provides = [
13
        ContextManager::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
     */
23
    public function register(): void
24
    {
25 1
        $this->getContainer()->share(ContextManager::class, function () {
26 1
            return new ContextManager(
27 1
                $this->getContainer(),
28 1
                $this->getContainer()->get(Cache::class)
29
            );
30 1
        });
31 1
    }
32
}
33