Loader::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 9
ccs 6
cts 6
cp 1
crap 2
rs 9.6666
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