Loader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 9 2
1
<?php
2
3
namespace Penny\Config;
4
5
use Zend\Stdlib\ArrayUtils;
6
use Zend\Stdlib\Glob;
7
8
class Loader
9
{
10
    /**
11
     * Configurations loader.
12
     *
13
     * @param string $pathRole Glob role.
14
     *
15
     * @return array
16
     */
17 22
    public static function load($pathRole = './config/{{*}}{{,*.local}}.php')
18
    {
19 22
        $config = [];
20 22
        foreach (Glob::glob($pathRole, Glob::GLOB_BRACE) as $file) {
21 6
            $config = ArrayUtils::merge($config, include $file);
22 22
        }
23
24 22
        return $config;
25
    }
26
}
27