Conditions | 3 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 17 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
15 | 29 | public function compile(\Twig_Compiler $compiler) |
|
16 | { |
||
17 | 29 | $compiler->addDebugInfo($this) |
|
18 | 29 | ->write("ob_start();\n") |
|
19 | 29 | ->write('$documentProperties = ') |
|
20 | 29 | ->subcompile($this->getNode('properties')) |
|
21 | 29 | ->raw(';'.PHP_EOL) |
|
22 | 29 | ->write(self::CODE_INSTANCE.' = new '.PhpSpreadsheetWrapper::class.'($context, $this->env);'.PHP_EOL) |
|
23 | 29 | ->write(self::CODE_INSTANCE.'->startDocument($documentProperties);'.PHP_EOL) |
|
24 | 29 | ->write('unset($documentProperties);'.PHP_EOL) |
|
25 | 29 | ->subcompile($this->getNode('body')) |
|
26 | 29 | ->addDebugInfo($this) |
|
27 | 29 | ->write("ob_end_clean();\n") |
|
28 | 29 | ->write(self::CODE_INSTANCE.'->endDocument('. |
|
29 | 29 | ($this->getAttribute('preCalculateFormulas') ? 'true' : 'false').', '. |
|
30 | 29 | ($this->getAttribute('diskCachingDirectory') ? '\''.$this->getAttribute('diskCachingDirectory').'\'' : 'null').');'.PHP_EOL) |
|
31 | 29 | ->write('unset('.self::CODE_INSTANCE.');'.PHP_EOL); |
|
32 | 29 | } |
|
33 | |||
42 |