Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | protected function parseFile(string $strConfigFile) : array |
||
24 | { |
||
25 | if (!file_exists($strConfigFile)) { |
||
26 | trigger_error('Config File (' . $strConfigFile . ') does not exist!', E_USER_WARNING); |
||
27 | return []; |
||
28 | } |
||
29 | |||
30 | $strJson = file_get_contents($strConfigFile); |
||
31 | $aJSON = json_decode($strJson, true); |
||
32 | if ($aJSON === null) { |
||
33 | trigger_error('Invalid config file (' . $strConfigFile . '): ' . json_last_error_msg(), E_USER_ERROR); |
||
34 | } |
||
35 | return $aJSON; |
||
36 | } |
||
38 |