| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 56 | public function depend(string $key): AbstractConfig |
||
| 57 | { |
||
| 58 | if (!isset($this->$key)) { |
||
| 59 | $trail = [$key]; |
||
| 60 | |||
| 61 | $config = $this; |
||
| 62 | while ($config->___parent) { |
||
| 63 | $trail[] = $config->___key; |
||
| 64 | $config = $config->___parent; |
||
| 65 | } |
||
| 66 | |||
| 67 | throw new MissingConfigException(array_reverse($trail)); |
||
| 68 | } |
||
| 69 | return $this; |
||
| 70 | } |
||
| 71 | } |