Conditions | 4 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
26 | private function reducer(string $dotPath): callable |
||
27 | { |
||
28 | 2 | return static function ($currentValue, ConfigInterface $config) use ($dotPath) { |
|
29 | 2 | $found = $config->get($dotPath, null); |
|
30 | |||
31 | 2 | if ($found === null) { |
|
32 | 2 | return $currentValue; |
|
33 | } |
||
34 | |||
35 | 2 | if (is_array($currentValue) && is_array($found)) { |
|
36 | 1 | return array_replace_recursive($currentValue, $found); |
|
37 | } |
||
38 | |||
39 | 2 | return $found; |
|
40 | 2 | }; |
|
41 | } |
||
42 | } |
||
43 |