Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public static function read(string $sConfigFile): array |
||
40 | { |
||
41 | $sConfigFile = realpath($sConfigFile); |
||
42 | if(!extension_loaded('yaml')) |
||
43 | { |
||
44 | throw new YamlExtension(); |
||
45 | } |
||
46 | if(!is_readable($sConfigFile)) |
||
47 | { |
||
48 | throw new FileAccess($sConfigFile); |
||
49 | } |
||
50 | $aConfigOptions = yaml_parse_file($sConfigFile); |
||
51 | if(!is_array($aConfigOptions)) |
||
52 | { |
||
53 | throw new FileContent($sConfigFile); |
||
54 | } |
||
55 | |||
56 | return $aConfigOptions; |
||
57 | } |
||
59 |