Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public static function read(string $sConfigFile): array |
||
38 | { |
||
39 | $sConfigFile = realpath($sConfigFile); |
||
40 | if(!is_readable($sConfigFile)) |
||
41 | { |
||
42 | throw new FileAccess($sConfigFile); |
||
43 | } |
||
44 | $sFileContent = file_get_contents($sConfigFile); |
||
45 | $aConfigOptions = json_decode($sFileContent, true); |
||
46 | if(!is_array($aConfigOptions)) |
||
47 | { |
||
48 | throw new FileContent($sConfigFile); |
||
49 | } |
||
50 | |||
51 | return $aConfigOptions; |
||
52 | } |
||
54 |