| Conditions | 3 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 25 | public function parse($path) |
||
| 26 | { |
||
| 27 | try { |
||
| 28 | $data = null; |
||
| 29 | if (! extension_loaded('yaml')) { |
||
| 30 | $data = spyc_load_file($path); |
||
| 31 | } else { |
||
| 32 | $data = yaml_parse_file($path); |
||
| 33 | } |
||
| 34 | } catch (Exception $ex) { |
||
| 35 | throw new ParseException( |
||
| 36 | [ |
||
| 37 | 'message' => 'Error parsing YAML file', |
||
| 38 | 'exception' => $ex, |
||
| 39 | ] |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $data; |
||
| 44 | } |
||
| 45 | |||
| 56 |