@@ -138,8 +138,8 @@ |
||
| 138 | 138 | private function parseBody(): \Twig_Node |
| 139 | 139 | { |
| 140 | 140 | // parse body |
| 141 | - $body = $this->parser->subparse(function (\Twig_Token $token) { |
|
| 142 | - return $token->test('end'.$this->getTag()); |
|
| 141 | + $body = $this->parser->subparse(function(\Twig_Token $token) { |
|
| 142 | + return $token->test('end' . $this->getTag()); |
|
| 143 | 143 | }, |
| 144 | 144 | true |
| 145 | 145 | ); |
@@ -14,12 +14,12 @@ |
||
| 14 | 14 | { |
| 15 | 15 | $compiler->addDebugInfo($this) |
| 16 | 16 | ->write(self::CODE_FIX_CONTEXT) |
| 17 | - ->write(self::CODE_INSTANCE.'->startAlignment(\'right\');'.PHP_EOL) |
|
| 17 | + ->write(self::CODE_INSTANCE . '->startAlignment(\'right\');' . PHP_EOL) |
|
| 18 | 18 | ->write("ob_start();\n") |
| 19 | 19 | ->subcompile($this->getNode('body')) |
| 20 | - ->write('$rightValue = trim(ob_get_clean());'.PHP_EOL) |
|
| 21 | - ->write(self::CODE_INSTANCE.'->endAlignment($rightValue);'.PHP_EOL) |
|
| 22 | - ->write('unset($rightValue);'.PHP_EOL); |
|
| 20 | + ->write('$rightValue = trim(ob_get_clean());' . PHP_EOL) |
|
| 21 | + ->write(self::CODE_INSTANCE . '->endAlignment($rightValue);' . PHP_EOL) |
|
| 22 | + ->write('unset($rightValue);' . PHP_EOL); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -45,17 +45,17 @@ |
||
| 45 | 45 | ->write("ob_start();\n") |
| 46 | 46 | ->write('$documentProperties = ') |
| 47 | 47 | ->subcompile($this->getNode('properties')) |
| 48 | - ->raw(';'.PHP_EOL) |
|
| 49 | - ->write(self::CODE_INSTANCE.' = new '.PhpSpreadsheetWrapper::class.'($context, $this->env);'.PHP_EOL) |
|
| 50 | - ->write(self::CODE_INSTANCE.'->startDocument($documentProperties);'.PHP_EOL) |
|
| 51 | - ->write('unset($documentProperties);'.PHP_EOL) |
|
| 48 | + ->raw(';' . PHP_EOL) |
|
| 49 | + ->write(self::CODE_INSTANCE . ' = new ' . PhpSpreadsheetWrapper::class . '($context, $this->env);' . PHP_EOL) |
|
| 50 | + ->write(self::CODE_INSTANCE . '->startDocument($documentProperties);' . PHP_EOL) |
|
| 51 | + ->write('unset($documentProperties);' . PHP_EOL) |
|
| 52 | 52 | ->subcompile($this->getNode('body')) |
| 53 | 53 | ->addDebugInfo($this) |
| 54 | 54 | ->write("ob_end_clean();\n") |
| 55 | - ->write(self::CODE_INSTANCE.'->endDocument('. |
|
| 56 | - ($this->preCalculateFormulas ? 'true' : 'false').', '. |
|
| 57 | - ($this->diskCachingDirectory ? '\''.$this->diskCachingDirectory.'\'' : 'null').');'.PHP_EOL) |
|
| 58 | - ->write('unset('.self::CODE_INSTANCE.');'.PHP_EOL); |
|
| 55 | + ->write(self::CODE_INSTANCE . '->endDocument(' . |
|
| 56 | + ($this->preCalculateFormulas ? 'true' : 'false') . ', ' . |
|
| 57 | + ($this->diskCachingDirectory ? '\'' . $this->diskCachingDirectory . '\'' : 'null') . ');' . PHP_EOL) |
|
| 58 | + ->write('unset(' . self::CODE_INSTANCE . ');' . PHP_EOL); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -16,19 +16,19 @@ |
||
| 16 | 16 | ->write(self::CODE_FIX_CONTEXT) |
| 17 | 17 | ->write('$sheetIndex = ') |
| 18 | 18 | ->subcompile($this->getNode('index')) |
| 19 | - ->raw(';'.PHP_EOL) |
|
| 19 | + ->raw(';' . PHP_EOL) |
|
| 20 | 20 | ->write('$sheetProperties = ') |
| 21 | 21 | ->subcompile($this->getNode('properties')) |
| 22 | - ->raw(';'.PHP_EOL) |
|
| 23 | - ->write(self::CODE_INSTANCE.'->startSheet($sheetIndex, $sheetProperties);'.PHP_EOL) |
|
| 24 | - ->write('unset($sheetIndex, $sheetProperties);'.PHP_EOL); |
|
| 22 | + ->raw(';' . PHP_EOL) |
|
| 23 | + ->write(self::CODE_INSTANCE . '->startSheet($sheetIndex, $sheetProperties);' . PHP_EOL) |
|
| 24 | + ->write('unset($sheetIndex, $sheetProperties);' . PHP_EOL); |
|
| 25 | 25 | |
| 26 | 26 | if ($this->hasNode('body')) { |
| 27 | 27 | $compiler->subcompile($this->getNode('body')); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $compiler->addDebugInfo($this) |
| 31 | - ->write(self::CODE_INSTANCE.'->endSheet();'.PHP_EOL); |
|
| 31 | + ->write(self::CODE_INSTANCE . '->endSheet();' . PHP_EOL); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -12,12 +12,12 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * @var string |
| 14 | 14 | */ |
| 15 | - const CODE_FIX_CONTEXT = '$context = '.PhpSpreadsheetWrapper::class.'::fixContext($context);'.PHP_EOL; |
|
| 15 | + const CODE_FIX_CONTEXT = '$context = ' . PhpSpreadsheetWrapper::class . '::fixContext($context);' . PHP_EOL; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * @var string |
| 19 | 19 | */ |
| 20 | - const CODE_INSTANCE = '$context[\''.PhpSpreadsheetWrapper::INSTANCE_KEY.'\']'; |
|
| 20 | + const CODE_INSTANCE = '$context[\'' . PhpSpreadsheetWrapper::INSTANCE_KEY . '\']'; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * @return string[] |
@@ -16,16 +16,16 @@ |
||
| 16 | 16 | ->write(self::CODE_FIX_CONTEXT) |
| 17 | 17 | ->write('$headerType = ') |
| 18 | 18 | ->subcompile($this->getNode('type')) |
| 19 | - ->raw(';'.PHP_EOL) |
|
| 20 | - ->write('$headerType = $headerType ? $headerType : \'header\';'.PHP_EOL) |
|
| 19 | + ->raw(';' . PHP_EOL) |
|
| 20 | + ->write('$headerType = $headerType ? $headerType : \'header\';' . PHP_EOL) |
|
| 21 | 21 | ->write('$headerProperties = ') |
| 22 | 22 | ->subcompile($this->getNode('properties')) |
| 23 | - ->raw(';'.PHP_EOL) |
|
| 24 | - ->write(self::CODE_INSTANCE.'->startHeaderFooter($headerType, $headerProperties);'.PHP_EOL) |
|
| 25 | - ->write('unset($headerType, $headerProperties);'.PHP_EOL) |
|
| 23 | + ->raw(';' . PHP_EOL) |
|
| 24 | + ->write(self::CODE_INSTANCE . '->startHeaderFooter($headerType, $headerProperties);' . PHP_EOL) |
|
| 25 | + ->write('unset($headerType, $headerProperties);' . PHP_EOL) |
|
| 26 | 26 | ->subcompile($this->getNode('body')) |
| 27 | 27 | ->addDebugInfo($this) |
| 28 | - ->write(self::CODE_INSTANCE.'->endHeaderFooter();'.PHP_EOL); |
|
| 28 | + ->write(self::CODE_INSTANCE . '->endHeaderFooter();' . PHP_EOL); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -16,13 +16,13 @@ |
||
| 16 | 16 | ->write(self::CODE_FIX_CONTEXT) |
| 17 | 17 | ->write('$drawingPath = ') |
| 18 | 18 | ->subcompile($this->getNode('path')) |
| 19 | - ->raw(';'.PHP_EOL) |
|
| 19 | + ->raw(';' . PHP_EOL) |
|
| 20 | 20 | ->write('$drawingProperties = ') |
| 21 | 21 | ->subcompile($this->getNode('properties')) |
| 22 | - ->raw(';'.PHP_EOL) |
|
| 23 | - ->write(self::CODE_INSTANCE.'->startDrawing($drawingPath, $drawingProperties);'.PHP_EOL) |
|
| 24 | - ->write('unset($drawingPath, $drawingProperties);'.PHP_EOL) |
|
| 25 | - ->write(self::CODE_INSTANCE.'->endDrawing();'.PHP_EOL); |
|
| 22 | + ->raw(';' . PHP_EOL) |
|
| 23 | + ->write(self::CODE_INSTANCE . '->startDrawing($drawingPath, $drawingProperties);' . PHP_EOL) |
|
| 24 | + ->write('unset($drawingPath, $drawingProperties);' . PHP_EOL) |
|
| 25 | + ->write(self::CODE_INSTANCE . '->endDrawing();' . PHP_EOL); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -14,12 +14,12 @@ |
||
| 14 | 14 | { |
| 15 | 15 | $compiler->addDebugInfo($this) |
| 16 | 16 | ->write(self::CODE_FIX_CONTEXT) |
| 17 | - ->write(self::CODE_INSTANCE.'->startAlignment(\'center\');'.PHP_EOL) |
|
| 17 | + ->write(self::CODE_INSTANCE . '->startAlignment(\'center\');' . PHP_EOL) |
|
| 18 | 18 | ->write("ob_start();\n") |
| 19 | 19 | ->subcompile($this->getNode('body')) |
| 20 | - ->write('$centerValue = trim(ob_get_clean());'.PHP_EOL) |
|
| 21 | - ->write(self::CODE_INSTANCE.'->endAlignment($centerValue);'.PHP_EOL) |
|
| 22 | - ->write('unset($centerValue);'.PHP_EOL); |
|
| 20 | + ->write('$centerValue = trim(ob_get_clean());' . PHP_EOL) |
|
| 21 | + ->write(self::CODE_INSTANCE . '->endAlignment($centerValue);' . PHP_EOL) |
|
| 22 | + ->write('unset($centerValue);' . PHP_EOL); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -14,18 +14,18 @@ |
||
| 14 | 14 | { |
| 15 | 15 | $compiler->addDebugInfo($this) |
| 16 | 16 | ->write(self::CODE_FIX_CONTEXT) |
| 17 | - ->write(self::CODE_INSTANCE.'->setCellIndex(') |
|
| 17 | + ->write(self::CODE_INSTANCE . '->setCellIndex(') |
|
| 18 | 18 | ->subcompile($this->getNode('index')) |
| 19 | - ->raw(');'.PHP_EOL) |
|
| 19 | + ->raw(');' . PHP_EOL) |
|
| 20 | 20 | ->write("ob_start();\n") |
| 21 | 21 | ->subcompile($this->getNode('body')) |
| 22 | - ->write('$cellValue = trim(ob_get_clean());'.PHP_EOL) |
|
| 22 | + ->write('$cellValue = trim(ob_get_clean());' . PHP_EOL) |
|
| 23 | 23 | ->write('$cellProperties = ') |
| 24 | 24 | ->subcompile($this->getNode('properties')) |
| 25 | - ->raw(';'.PHP_EOL) |
|
| 26 | - ->write(self::CODE_INSTANCE.'->startCell($cellValue, $cellProperties);'.PHP_EOL) |
|
| 27 | - ->write('unset($cellIndex, $cellValue, $cellProperties);'.PHP_EOL) |
|
| 28 | - ->write(self::CODE_INSTANCE.'->endCell();'.PHP_EOL); |
|
| 25 | + ->raw(';' . PHP_EOL) |
|
| 26 | + ->write(self::CODE_INSTANCE . '->startCell($cellValue, $cellProperties);' . PHP_EOL) |
|
| 27 | + ->write('unset($cellIndex, $cellValue, $cellProperties);' . PHP_EOL) |
|
| 28 | + ->write(self::CODE_INSTANCE . '->endCell();' . PHP_EOL); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |