| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 3 | public function parseFile($path) |
|
| 21 | { |
||
| 22 | 3 | $error = ErrorCatcher::create(); |
|
| 23 | |||
| 24 | 3 | $result = yaml_parse_file($path, 0); |
|
| 25 | |||
| 26 | 3 | $result = $error->end() ? null : $result; |
|
| 27 | |||
| 28 | 3 | return !is_array($result) |
|
| 29 | 2 | ? null |
|
| 30 | # libyaml parser does aliases, remove any potential ones |
||
| 31 | 3 | : json_decode(json_encode($result), true); |
|
| 32 | } |
||
| 45 |