| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | 14 | public static function loadHtml(string $html, array $options = []): \DOMDocument |
|
| 29 | { |
||
| 30 | 14 | $parser = new HTML5(); |
|
| 31 | |||
| 32 | // Load Document |
||
| 33 | 14 | $doc = $parser->loadHTML($html, $options); |
|
| 34 | 14 | if ($parser->hasErrors()) { |
|
| 35 | 1 | throw new Html5Exception(null, 0, array_map( |
|
| 36 | 1 | function ($message) use ($html) { |
|
| 37 | 1 | return new Html5ParseException($message, $html); |
|
| 38 | 1 | }, |
|
| 39 | |||
| 40 | 1 | $parser->getErrors(), |
|
| 41 | 1 | )); |
|
| 42 | } |
||
| 43 | |||
| 44 | 13 | return $doc; |
|
| 45 | } |
||
| 65 |