Test Setup Failed
Push — master ( 562b48...254002 )
by Gabriel
04:15 queued 14s
created

CacheServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
dl 0
loc 34
ccs 12
cts 14
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 3

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 1
A registerManager() 0 6 1
A registerDefaultStore() 0 6 1
A provides() 0 7 1
1
<?php
2
3
namespace Nip\Cache;
4
5
use Nip\Container\ServiceProviders\Providers\AbstractServiceProvider;
6
7
/**
8
 * Class CacheServiceProvider
9
 * @package Nip\Cache
10
 *
11
 */
12
class CacheServiceProvider extends AbstractServiceProvider
13
{
14 1
    public function register()
15
    {
16 1
        $this->registerManager();
17 1
        $this->registerDefaultStore();
18 1
    }
19
20 1
    protected function registerManager()
21
    {
22
        $this->getContainer()->share('cache', function () {
23 1
            return new CacheManager();
24 1
        });
25 1
    }
26
27 1
    protected function registerDefaultStore()
28
    {
29
        $this->getContainer()->share('cache.store', function () {
30 1
            return $this->getContainer()->get('cache')->store();
31 1
        });
32 1
    }
33
34
35
    /**
36
     * @inheritdoc
37
     */
38
    public function provides()
39
    {
40
        return [
41
            'cache',
42
            'cache.store',
43
        ];
44
    }
45
}
46