Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function compile(Compiler $compiler): void |
||
31 | { |
||
32 | $compiler |
||
33 | ->addDebugInfo($this) |
||
34 | ->write('$_templateTimer = microtime(true)') |
||
35 | ->raw(";\n") |
||
36 | ->write('$_templateName = ') |
||
37 | ->subcompile($this->getNode('templateName')) |
||
38 | ->raw(";\n") |
||
39 | ->write('echo PHP_EOL."<!-- >>> TEMPLATE BEGIN >>> ".$_templateName." -->".PHP_EOL') |
||
40 | ->raw(";\n"); |
||
41 | // Make sure there is a body node |
||
42 | if (!empty($this->nodes['body'])) { |
||
43 | $compiler |
||
44 | ->indent() |
||
45 | ->subcompile($this->getNode('body')) |
||
46 | ->outdent(); |
||
47 | } |
||
48 | $compiler |
||
49 | ->write('echo PHP_EOL."<!-- <<< TEMPLATE END <<< FROM ".$_templateName." TIME ".number_format((microtime(true)-$_templateTimer)*1000,2)."ms -->".PHP_EOL') |
||
50 | ->raw(";\n") |
||
51 | ->write("unset(\$_templateName);\n") |
||
52 | ->write("unset(\$_templateTimer);\n"); |
||
53 | } |
||
55 |