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

CacheServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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