| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | protected function parseFile(string $strConfigFile) : array |
||
| 33 | { |
||
| 34 | if (!file_exists($strConfigFile)) { |
||
| 35 | trigger_error('Config File (' . $strConfigFile . ') does not exist!', E_USER_WARNING); |
||
| 36 | } |
||
| 37 | |||
| 38 | $strJson = file_get_contents($strConfigFile); |
||
| 39 | $aJSON = json_decode($strJson, true); |
||
| 40 | if ($aJSON === null) { |
||
| 41 | trigger_error('Invalid config file (' . $strConfigFile . '): ' . json_last_error_msg(), E_USER_ERROR); |
||
| 42 | } |
||
| 43 | return $aJSON; |
||
| 44 | } |
||
| 46 |