DatabaseServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
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