Conditions | 4 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function compile(Compiler $compiler): void |
||
32 | { |
||
33 | $html = $this->getAttribute('html'); |
||
34 | $css = $this->getAttribute('css'); |
||
35 | $js = $this->getAttribute('js'); |
||
36 | |||
37 | $compiler |
||
38 | ->addDebugInfo($this); |
||
39 | |||
40 | $compiler |
||
41 | ->write("ob_start();\n") |
||
42 | ->subcompile($this->getNode('body')) |
||
43 | ->write("\$_compiledBody = ob_get_clean();\n"); |
||
44 | |||
45 | if ($html) { |
||
46 | $compiler |
||
47 | ->write("echo " . Minify::class . "::\$plugin->minify->htmlMin(\$_compiledBody);\n"); |
||
48 | } elseif ($css) { |
||
49 | $compiler |
||
50 | ->write("echo " . Minify::class . "::\$plugin->minify->cssMin(\$_compiledBody);\n"); |
||
51 | } elseif ($js) { |
||
52 | $compiler |
||
53 | ->write("echo " . Minify::class . "::\$plugin->minify->jsMin(\$_compiledBody);\n"); |
||
54 | } else { |
||
55 | $compiler |
||
56 | ->write("echo " . Minify::class . "::\$plugin->minify->minify(\$_compiledBody);\n"); |
||
57 | } |
||
60 |