Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | protected function decode(string $configPath): array |
||
33 | { |
||
34 | try { |
||
35 | $configArray = Json::decode(file_get_contents($configPath)); |
||
36 | } catch (JsonException $exception) { |
||
37 | throw new InvalidConfigException('Unable to parse JSON config'); |
||
38 | } |
||
39 | if (! is_array($configArray)) { |
||
40 | throw new InvalidConfigException('Invalid JSON config'); |
||
41 | } |
||
42 | return $configArray; |
||
43 | } |
||
45 |