Conditions | 2 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
19 | 5 | public function process(MinifyContext $context) |
|
20 | { |
||
21 | 5 | return $context->setContents(preg_replace_callback( |
|
22 | 5 | '/ |
|
23 | <! # search for the start of a comment |
||
24 | [^>]* # search for everything without a ">" |
||
25 | > # match the end of the comment |
||
26 | 5 | /xs', function ($match) { |
|
27 | 2 | if (Str::contains(strtolower($match[0]), 'doctype')) { |
|
28 | 1 | return $match[0]; |
|
29 | } |
||
30 | |||
31 | 2 | return ''; |
|
32 | 5 | }, $context->getContents())); |
|
33 | } |
||
34 | |||
45 |