| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class AbstractTidyAdapter extends ParentAbstractAdapter |
||
| 9 | { |
||
| 10 | protected function postProcess(string $htmlMinified): string |
||
| 11 | { |
||
| 12 | $htmlMinified = $this->trim($htmlMinified); |
||
| 13 | |||
| 14 | return $this->doctype($htmlMinified); |
||
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Tidy removes the doctype when parsing HTML5 (bug?). |
||
| 19 | * This causes the browser to switch to quirks mode, which is undesirable. |
||
| 20 | * This method re-adds the doctype in the case of HTML5. |
||
| 21 | */ |
||
| 22 | private function doctype(string $html): string |
||
| 39 | } |
||
| 40 | } |
||
| 41 |