| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | 12 | public static function toHtml(\DOMDocument $doc, array $options = []): string |
|
| 48 | { |
||
| 49 | // Normalize final doc |
||
| 50 | 12 | if ($options['normalize_document'] ?? true) { |
|
| 51 | 12 | $doc->normalize(); |
|
| 52 | } |
||
| 53 | |||
| 54 | // Generate output |
||
| 55 | 12 | $html = (new HTML5())->saveHTML($doc, $options); |
|
| 56 | |||
| 57 | // Fix EOL lines |
||
| 58 | 12 | if (($options['normalize_eol'] ?? "\n") !== \PHP_EOL) { |
|
| 59 | $html = str_replace(\PHP_EOL, $options['normalize_eol'] ?? "\n", $html); // @codeCoverageIgnore |
||
| 60 | } |
||
| 61 | |||
| 62 | 12 | return $html; |
|
| 63 | } |
||
| 65 |