| Conditions | 3 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 11 | public static function create( |
|
| 22 | ConfigPaths $paths, |
||
| 23 | ?string $environment, |
||
| 24 | ?string $configGroupPostfix = null, |
||
| 25 | ): Config { |
||
| 26 | 11 | $paramsGroups = ['params']; |
|
| 27 | 11 | if ($configGroupPostfix !== null) { |
|
| 28 | 9 | $paramsGroups[] = 'params-' . $configGroupPostfix; |
|
| 29 | } |
||
| 30 | |||
| 31 | 11 | $eventGroups = ['events']; |
|
| 32 | 11 | if ($configGroupPostfix !== null) { |
|
| 33 | 9 | $eventGroups[] = 'events-' . $configGroupPostfix; |
|
| 34 | } |
||
| 35 | |||
| 36 | 11 | return new Config( |
|
| 37 | 11 | $paths, |
|
| 38 | 11 | $environment, |
|
| 39 | 11 | [ |
|
| 40 | 11 | ReverseMerge::groups(...$eventGroups), |
|
| 41 | 11 | RecursiveMerge::groups(...$paramsGroups, ...$eventGroups), |
|
| 42 | 11 | ], |
|
| 43 | 11 | 'params', |
|
| 44 | 11 | ); |
|
| 47 |