ConfigProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 20
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gewaer\Providers;
6
7
use Canvas\Providers\ConfigProvider as CanvasConfigProvider;
8
use function Canvas\Core\appPath;
9
use Phalcon\DiInterface;
10
use Phalcon\Config;
11
12
class ConfigProvider extends CanvasConfigProvider
13
{
14
    /**
15
        * @param DiInterface $container
16
        */
17 90
    public function register(DiInterface $container)
18
    {
19 90
        $container->setShared(
20 90
            'config',
21
            function () {
22
                /**
23
                 * @todo Find a better way to handle unit test file include
24
                 */
25 77
                $data = require appPath('library/Core/config.php');
26
27 77
                return new Config($data);
28 90
            }
29
        );
30 90
    }
31
}
32