| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | protected function decode(string $configPath): array |
||
| 33 | { |
||
| 34 | try { |
||
| 35 | $configArray = Yaml::parse(file_get_contents($configPath)); |
||
| 36 | } catch (ParseException $exception) { |
||
| 37 | throw new InvalidConfigException(sprintf( |
||
| 38 | 'Unable to parse YAML config: %s', |
||
| 39 | $exception->getMessage() |
||
| 40 | )); |
||
| 41 | } |
||
| 42 | if (! is_array($configArray)) { |
||
| 43 | throw new InvalidConfigException('Invalid YAML config'); |
||
| 44 | } |
||
| 45 | return $configArray; |
||
| 46 | } |
||
| 48 |