Test Failed
Push — master ( 1d36f2...d1fcad )
by Alexander
10:56 queued 08:05
created

ConfigFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

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
use Yiisoft\Config\Modifier\RecursiveMerge;
10
use Yiisoft\Config\Modifier\ReverseMerge;
11
12
use function dirname;
13
14
final class ConfigFactory
15
{
16
    public static function create(?string $environment): Config
17
    {
18
        $eventGroups = [
19
            'events',
20
            'events-web',
21
            'events-console',
22
        ];
23
24
        return new Config(
25
            new ConfigPaths(dirname(__DIR__, 2)),
26
            $environment,
27
            [
28
                ReverseMerge::groups(...$eventGroups),
29
                RecursiveMerge::groups('params', ...$eventGroups),
30
            ],
31
        );
32
    }
33
}
34