Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
34 | 4 | public function parseBuffer($buffer) |
|
35 | { |
||
36 | 4 | $error = ErrorCatcher::create(); |
|
37 | 4 | $result = yaml_parse($buffer, 0); |
|
38 | 4 | $result = $error->end() ? null : $result; |
|
39 | |||
40 | 4 | return !is_array($result) |
|
41 | 2 | ? null |
|
42 | # ext-yaml parser does aliases, remove any potential ones |
||
43 | 4 | : json_decode(json_encode($result), true); |
|
44 | } |
||
46 |