| Total Complexity | 7 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | class ConfigCollection implements ConfigInterface |
||
| 7 | { |
||
| 8 | /** @var ConfigInterface[] */ |
||
| 9 | private $configs; |
||
| 10 | |||
| 11 | public function __construct(ConfigInterface ...$configs) |
||
| 12 | { |
||
| 13 | $this->configs = $configs; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function get(string $dotPath, $default = null) |
||
| 17 | { |
||
| 18 | return array_reduce(array_reverse($this->configs), $this->reducer($dotPath), $default); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function set(string $dotPath, $value, $hard = false) |
||
| 24 | } |
||
| 25 | |||
| 26 | private function reducer(string $dotPath): callable |
||
| 40 | }; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |