CacheServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author    jan huang <[email protected]>
4
 * @copyright 2016
5
 *
6
 * @see      https://www.github.com/janhuang
7
 * @see      https://fastdlabs.com
8
 */
9
10
namespace FastD\ServiceProvider;
11
12
use FastD\Container\Container;
13
use FastD\Container\ServiceProviderInterface;
14
use FastD\Pool\CachePool;
15
16
/**
17
 * Class CacheServiceProvider.
18
 */
19
class CacheServiceProvider implements ServiceProviderInterface
20
{
21
    /**
22
     * @param Container $container
23
     *
24
     * @return mixed
25
     */
26 32
    public function register(Container $container)
27
    {
28 32
        $config = $container->get('config')->get('cache');
29
30 32
        $container->add('cache', new CachePool($config));
31
32 32
        unset($config);
33 32
    }
34
}
35