Test Failed
Push — master ( 084381...c83f36 )
by Evgeniy
03:18
created

ConfigFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 9
c 1
b 1
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Runner;
6
7
use Yiisoft\Config\Config;
8
use Yiisoft\Config\ConfigPaths;
9
10
use Yiisoft\Config\Modifier\RecursiveMerge;
11
use Yiisoft\Config\Modifier\ReverseMerge;
12
13
use function dirname;
14
15
final class ConfigFactory
16
{
17
    public static function create(?string $environment): Config
18
    {
19
        $eventGroups = [
20
            'events',
21
            'events-web',
22
            'events-console',
23
        ];
24
25
        return new Config(
26
            new ConfigPaths(dirname(__DIR__, 2), 'config'),
27
            $environment,
28
            [
29
                ReverseMerge::groups(...$eventGroups),
30
                RecursiveMerge::groups('params', ...$eventGroups),
31
            ],
32
        );
33
    }
34
}
35