| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | private function doctype(string $html): string |
||
| 23 | { |
||
| 24 | $config = $this->getConfig(); |
||
| 25 | |||
| 26 | if (!isset($config['doctype'])) { |
||
| 27 | return $html; |
||
| 28 | } |
||
| 29 | |||
| 30 | if ('html5' !== $config['doctype']) { |
||
| 31 | return $html; |
||
| 32 | } |
||
| 33 | |||
| 34 | if (str_starts_with($html, $prefix = '<!DOCTYPE html>')) { |
||
| 35 | return $html; |
||
| 36 | } |
||
| 37 | |||
| 38 | return $prefix . PHP_EOL . $html; |
||
| 39 | } |
||
| 41 |