| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 45 | 81 | public static function instance(?string $html = null) |
|
| 46 | { |
||
| 47 | 81 | libxml_use_internal_errors(true); |
|
| 48 | 81 | $doc = new DOMDocument(); |
|
| 49 | 81 | if (!is_null($html)) { |
|
| 50 | 81 | $doc->loadHTML($html, LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); |
|
| 51 | } |
||
| 52 | |||
| 53 | 81 | return new HtmlDocument($doc); |
|
| 54 | } |
||
| 56 |