Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | public function depend(string $key): AbstractConfig |
||
50 | { |
||
51 | if (!isset($this->$key)) { |
||
52 | $trail = [$key]; |
||
53 | |||
54 | $config = $this; |
||
55 | while ($config->___parent) { |
||
56 | $trail[] = $config->___key; |
||
57 | $config = $config->___parent; |
||
58 | } |
||
59 | |||
60 | throw new MissingConfigException(array_reverse($trail)); |
||
61 | } |
||
62 | return $this; |
||
63 | } |
||
64 | } |