| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function decode(string $data): array |
||
| 22 | { |
||
| 23 | try { |
||
| 24 | $decoded = Yaml::parse($data); |
||
| 25 | } catch (ParseException $e) { |
||
| 26 | throw DeserializerRuntimeException::createNotParsable($this->getContentType()); |
||
| 27 | } |
||
| 28 | 4 | ||
| 29 | if (!is_array($decoded)) { |
||
| 30 | throw DeserializerRuntimeException::createNotParsable($this->getContentType()); |
||
| 31 | 4 | } |
|
| 32 | 1 | ||
| 33 | 1 | return $decoded; |
|
| 34 | } |
||
| 36 |