| Conditions | 6 |
| Paths | 8 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | 1 | public function get($dotPath, $default = null) |
|
| 14 | { |
||
| 15 | 1 | $found = null; |
|
| 16 | |||
| 17 | 1 | foreach (array_reverse($this->configs) as $config) { |
|
| 18 | |||
| 19 | /** @var ConfigInterface $config */ |
||
| 20 | |||
| 21 | 1 | $value = $config->get($dotPath, null); |
|
| 22 | |||
| 23 | 1 | if ($value === null) { |
|
| 24 | 1 | continue; |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | if (is_array($found) && is_array($value)) { |
|
| 28 | 1 | $found = array_replace_recursive($found, $value); |
|
| 29 | } else { |
||
| 30 | 1 | $found = $value; |
|
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | 1 | return $found !== null ? $found : $default; |
|
| 35 | } |
||
| 36 | } |
||
| 37 |