DatabaseServiceProvider::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\DatabasePool;
15
16
/**
17
 * Class DatabaseServiceProvider.
18
 */
19
class DatabaseServiceProvider implements ServiceProviderInterface
20
{
21
    /**
22
     * @param Container $container
23
     */
24 32
    public function register(Container $container)
25
    {
26 32
        $config = config()->get('database', []);
27
28 32
        $container->add('database', new DatabasePool($config));
29
30 32
        unset($config);
31 32
    }
32
}
33