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 | 8 | public static function toHtml(\DOMDocument $doc, array $options = []): string |
|
48 | { |
||
49 | // Normalize final doc |
||
50 | 8 | if ($options['normalize_document'] ?? true) { |
|
51 | 8 | $doc->normalize(); |
|
52 | } |
||
53 | |||
54 | // Generate output |
||
55 | 8 | $html = (new HTML5())->saveHTML($doc, $options); |
|
56 | |||
57 | // Fix EOL lines |
||
58 | 8 | if (($options['normalize_eol'] ?? "\n") !== \PHP_EOL) { |
|
59 | $html = str_replace(\PHP_EOL, $options['normalize_eol'] ?? "\n", $html); // @codeCoverageIgnore |
||
60 | } |
||
61 | |||
62 | 8 | return $html; |
|
63 | } |
||
65 |