| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 27 | public function parse(string $frontMatter) |
|
| 26 | { |
||
| 27 | 27 | if (! \class_exists(Yaml::class)) { |
|
| 28 | throw new \RuntimeException('Failed to parse yaml: "symfony/yaml" library is missing'); |
||
| 29 | } |
||
| 30 | |||
| 31 | try { |
||
| 32 | 27 | return Yaml::parse($frontMatter); |
|
| 33 | 9 | } catch (ParseException $ex) { |
|
| 34 | 9 | throw InvalidFrontMatterException::wrap($ex); |
|
| 35 | } |
||
| 38 |