| Conditions | 4 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 36 | protected function parseFile(string $strConfigFile) : array |
||
| 37 | { |
||
| 38 | if (!file_exists($strConfigFile)) { |
||
| 39 | trigger_error('Config File (' . $strConfigFile . ') does not exist!', E_USER_WARNING); |
||
| 40 | } |
||
| 41 | |||
| 42 | $strYaml = file_get_contents($strConfigFile); |
||
| 43 | $aYAML = []; |
||
| 44 | if ($strYaml !== false) { |
||
| 45 | $aYAML = yaml_parse($strYaml); |
||
| 46 | if ($aYAML === false) { |
||
| 47 | // no codecoverage: haven't found example to test for returnvalue of false |
||
| 48 | trigger_error('Invalid config file (' . $strConfigFile . ')', E_USER_ERROR); // @codeCoverageIgnore |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | return $aYAML; |
||
| 53 | } |
||
| 55 |