@@ -19,7 +19,7 @@  | 
                                                    ||
| 19 | 19 | */  | 
                                                        
| 20 | 20 | protected function loadInternal(array $mergedConfig, ContainerBuilder $container)  | 
                                                        
| 21 | 21 |      { | 
                                                        
| 22 | - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));  | 
                                                        |
| 22 | + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));  | 
                                                        |
| 23 | 23 |          $loader->load('services.xml'); | 
                                                        
| 24 | 24 | |
| 25 | 25 |          $container->setParameter('mewes_k_twig_excel.pre_calculate_formulas', $mergedConfig['pre_calculate_formulas']); | 
                                                        
@@ -63,7 +63,7 @@ discard block  | 
                                                    ||
| 63 | 63 | */  | 
                                                        
| 64 | 64 | public function getCacheDir()  | 
                                                        
| 65 | 65 |      { | 
                                                        
| 66 | - return __DIR__ . '/../../tmp/functional';  | 
                                                        |
| 66 | + return __DIR__.'/../../tmp/functional';  | 
                                                        |
| 67 | 67 | }  | 
                                                        
| 68 | 68 | |
| 69 | 69 | /**  | 
                                                        
@@ -71,6 +71,6 @@ discard block  | 
                                                    ||
| 71 | 71 | */  | 
                                                        
| 72 | 72 | public function getLogDir()  | 
                                                        
| 73 | 73 |      { | 
                                                        
| 74 | - return __DIR__ . '/../../tmp/functional/logs';  | 
                                                        |
| 74 | + return __DIR__.'/../../tmp/functional/logs';  | 
                                                        |
| 75 | 75 | }  | 
                                                        
| 76 | 76 | }  | 
                                                        
@@ -19,7 +19,7 @@  | 
                                                    ||
| 19 | 19 | */  | 
                                                        
| 20 | 20 | public function defaultAction($templateName)  | 
                                                        
| 21 | 21 |      { | 
                                                        
| 22 | -        return $this->render('TestBundle:Default:' . $templateName . '.xlsx.twig', | 
                                                        |
| 22 | +        return $this->render('TestBundle:Default:'.$templateName.'.xlsx.twig', | 
                                                        |
| 23 | 23 | ['data' => [  | 
                                                        
| 24 | 24 | ['name' => 'Everette Grim', 'salary' => 5458.0],  | 
                                                        
| 25 | 25 | ['name' => 'Nam Poirrier', 'salary' => 3233.0],  | 
                                                        
@@ -39,11 +39,11 @@ discard block  | 
                                                    ||
| 39 | 39 | protected function getDocument($templateName, $format)  | 
                                                        
| 40 | 40 |      { | 
                                                        
| 41 | 41 | // generate source from template  | 
                                                        
| 42 | - $source = static::$environment->loadTemplate($templateName . '.twig')->render(['app' => new MockGlobalVariables($format)]);  | 
                                                        |
| 42 | + $source = static::$environment->loadTemplate($templateName.'.twig')->render(['app' => new MockGlobalVariables($format)]);  | 
                                                        |
| 43 | 43 | |
| 44 | 44 | // create paths  | 
                                                        
| 45 | - $tempDirPath = __DIR__ . static::$TEMP_PATH;  | 
                                                        |
| 46 | - $tempFilePath = $tempDirPath . $templateName . '.' . $format;  | 
                                                        |
| 45 | + $tempDirPath = __DIR__.static::$TEMP_PATH;  | 
                                                        |
| 46 | + $tempFilePath = $tempDirPath.$templateName.'.'.$format;  | 
                                                        |
| 47 | 47 | |
| 48 | 48 | // create source directory if necessary  | 
                                                        
| 49 | 49 |          if (!file_exists($tempDirPath)) { | 
                                                        
@@ -88,9 +88,9 @@ discard block  | 
                                                    ||
| 88 | 88 | */  | 
                                                        
| 89 | 89 | public static function setUpBeforeClass()  | 
                                                        
| 90 | 90 |      { | 
                                                        
| 91 | - static::$environment = new Twig_Environment(new Twig_Loader_Filesystem(__DIR__ . static::$RESOURCE_PATH), ['strict_variables' => true]);  | 
                                                        |
| 91 | + static::$environment = new Twig_Environment(new Twig_Loader_Filesystem(__DIR__.static::$RESOURCE_PATH), ['strict_variables' => true]);  | 
                                                        |
| 92 | 92 | static::$environment->addExtension(new TwigExcelExtension());  | 
                                                        
| 93 | - static::$environment->setCache(__DIR__ . static::$TEMP_PATH);  | 
                                                        |
| 93 | + static::$environment->setCache(__DIR__.static::$TEMP_PATH);  | 
                                                        |
| 94 | 94 | }  | 
                                                        
| 95 | 95 | |
| 96 | 96 | /**  | 
                                                        
@@ -99,7 +99,7 @@ discard block  | 
                                                    ||
| 99 | 99 | public static function tearDownAfterClass()  | 
                                                        
| 100 | 100 |      { | 
                                                        
| 101 | 101 |          if (in_array(getenv('DELETE_TEMP_FILES'), ['true', '1', 1, true], true)) { | 
                                                        
| 102 | -            exec('rm -rf ' . __DIR__ . static::$TEMP_PATH); | 
                                                        |
| 102 | +            exec('rm -rf '.__DIR__.static::$TEMP_PATH); | 
                                                        |
| 103 | 103 | }  | 
                                                        
| 104 | 104 | }  | 
                                                        
| 105 | 105 | }  | 
                                                        
@@ -33,15 +33,15 @@  | 
                                                    ||
| 33 | 33 | $compiler->addDebugInfo($this)  | 
                                                        
| 34 | 34 |              ->write('$cellIndex = ') | 
                                                        
| 35 | 35 |              ->subcompile($this->getNode('index')) | 
                                                        
| 36 | -            ->raw(';' . PHP_EOL) | 
                                                        |
| 36 | +            ->raw(';'.PHP_EOL) | 
                                                        |
| 37 | 37 |              ->write("ob_start();\n") | 
                                                        
| 38 | 38 |              ->subcompile($this->getNode('body')) | 
                                                        
| 39 | -            ->write('$cellValue = trim(ob_get_clean());' . PHP_EOL) | 
                                                        |
| 39 | +            ->write('$cellValue = trim(ob_get_clean());'.PHP_EOL) | 
                                                        |
| 40 | 40 |              ->write('$cellProperties = ') | 
                                                        
| 41 | 41 |              ->subcompile($this->getNode('properties')) | 
                                                        
| 42 | -            ->raw(';' . PHP_EOL) | 
                                                        |
| 43 | -            ->write('$phpExcel->startCell($cellIndex, $cellValue, $cellProperties);' . PHP_EOL) | 
                                                        |
| 44 | -            ->write('unset($cellIndex, $cellValue, $cellProperties);' . PHP_EOL) | 
                                                        |
| 45 | -            ->write('$phpExcel->endCell();' . PHP_EOL); | 
                                                        |
| 42 | +            ->raw(';'.PHP_EOL) | 
                                                        |
| 43 | +            ->write('$phpExcel->startCell($cellIndex, $cellValue, $cellProperties);'.PHP_EOL) | 
                                                        |
| 44 | +            ->write('unset($cellIndex, $cellValue, $cellProperties);'.PHP_EOL) | 
                                                        |
| 45 | +            ->write('$phpExcel->endCell();'.PHP_EOL); | 
                                                        |
| 46 | 46 | }  | 
                                                        
| 47 | 47 | }  | 
                                                        
@@ -28,11 +28,11 @@  | 
                                                    ||
| 28 | 28 | public function compile(Twig_Compiler $compiler)  | 
                                                        
| 29 | 29 |      { | 
                                                        
| 30 | 30 | $compiler->addDebugInfo($this)  | 
                                                        
| 31 | -            ->write('$phpExcel->startAlignment(\'center\');' . PHP_EOL) | 
                                                        |
| 31 | +            ->write('$phpExcel->startAlignment(\'center\');'.PHP_EOL) | 
                                                        |
| 32 | 32 |              ->write("ob_start();\n") | 
                                                        
| 33 | 33 |              ->subcompile($this->getNode('body')) | 
                                                        
| 34 | -            ->write('$centerValue = trim(ob_get_clean());' . PHP_EOL) | 
                                                        |
| 35 | -            ->write('$phpExcel->endAlignment($centerValue);' . PHP_EOL) | 
                                                        |
| 36 | -            ->write('unset($centerValue);' . PHP_EOL); | 
                                                        |
| 34 | +            ->write('$centerValue = trim(ob_get_clean());'.PHP_EOL) | 
                                                        |
| 35 | +            ->write('$phpExcel->endAlignment($centerValue);'.PHP_EOL) | 
                                                        |
| 36 | +            ->write('unset($centerValue);'.PHP_EOL); | 
                                                        |
| 37 | 37 | }  | 
                                                        
| 38 | 38 | }  | 
                                                        
@@ -45,16 +45,16 @@  | 
                                                    ||
| 45 | 45 | $compiler->addDebugInfo($this)  | 
                                                        
| 46 | 46 |              ->write('$documentProperties = ') | 
                                                        
| 47 | 47 |              ->subcompile($this->getNode('properties')) | 
                                                        
| 48 | -            ->raw(';' . PHP_EOL) | 
                                                        |
| 49 | -            ->write('$phpExcel = new MewesK\TwigExcelBundle\Wrapper\PhpExcelWrapper($context);' . PHP_EOL) | 
                                                        |
| 50 | -            ->write('$phpExcel->startDocument($documentProperties);' . PHP_EOL) | 
                                                        |
| 51 | -            ->write('unset($documentProperties);' . PHP_EOL) | 
                                                        |
| 48 | +            ->raw(';'.PHP_EOL) | 
                                                        |
| 49 | +            ->write('$phpExcel = new MewesK\TwigExcelBundle\Wrapper\PhpExcelWrapper($context);'.PHP_EOL) | 
                                                        |
| 50 | +            ->write('$phpExcel->startDocument($documentProperties);'.PHP_EOL) | 
                                                        |
| 51 | +            ->write('unset($documentProperties);'.PHP_EOL) | 
                                                        |
| 52 | 52 |              ->subcompile($this->getNode('body')) | 
                                                        
| 53 | 53 | ->addDebugInfo($this)  | 
                                                        
| 54 | -            ->write('$phpExcel->endDocument(' . | 
                                                        |
| 55 | - ($this->preCalculateFormulas ? 'true' : 'false') . ', ' .  | 
                                                        |
| 56 | - ($this->diskCachingDirectory ? '\'' . $this->diskCachingDirectory . '\'' : 'null') . ');' . PHP_EOL)  | 
                                                        |
| 57 | -            ->write('unset($phpExcel);' . PHP_EOL); | 
                                                        |
| 54 | +            ->write('$phpExcel->endDocument('. | 
                                                        |
| 55 | + ($this->preCalculateFormulas ? 'true' : 'false').', '.  | 
                                                        |
| 56 | + ($this->diskCachingDirectory ? '\''.$this->diskCachingDirectory.'\'' : 'null').');'.PHP_EOL)  | 
                                                        |
| 57 | +            ->write('unset($phpExcel);'.PHP_EOL); | 
                                                        |
| 58 | 58 | |
| 59 | 59 | }  | 
                                                        
| 60 | 60 | }  | 
                                                        
@@ -32,12 +32,12 @@  | 
                                                    ||
| 32 | 32 | $compiler->addDebugInfo($this)  | 
                                                        
| 33 | 33 |              ->write('$drawingPath = ') | 
                                                        
| 34 | 34 |              ->subcompile($this->getNode('path')) | 
                                                        
| 35 | -            ->raw(';' . PHP_EOL) | 
                                                        |
| 35 | +            ->raw(';'.PHP_EOL) | 
                                                        |
| 36 | 36 |              ->write('$drawingProperties = ') | 
                                                        
| 37 | 37 |              ->subcompile($this->getNode('properties')) | 
                                                        
| 38 | -            ->raw(';' . PHP_EOL) | 
                                                        |
| 39 | -            ->write('$phpExcel->startDrawing($drawingPath, $drawingProperties);' . PHP_EOL) | 
                                                        |
| 40 | -            ->write('unset($drawingPath, $drawingProperties);' . PHP_EOL) | 
                                                        |
| 41 | -            ->write('$phpExcel->endDrawing();' . PHP_EOL); | 
                                                        |
| 38 | +            ->raw(';'.PHP_EOL) | 
                                                        |
| 39 | +            ->write('$phpExcel->startDrawing($drawingPath, $drawingProperties);'.PHP_EOL) | 
                                                        |
| 40 | +            ->write('unset($drawingPath, $drawingProperties);'.PHP_EOL) | 
                                                        |
| 41 | +            ->write('$phpExcel->endDrawing();'.PHP_EOL); | 
                                                        |
| 42 | 42 | }  | 
                                                        
| 43 | 43 | }  | 
                                                        
@@ -33,15 +33,15 @@  | 
                                                    ||
| 33 | 33 | $compiler->addDebugInfo($this)  | 
                                                        
| 34 | 34 |              ->write('$footerType = ') | 
                                                        
| 35 | 35 |              ->subcompile($this->getNode('type')) | 
                                                        
| 36 | -            ->raw(';' . PHP_EOL) | 
                                                        |
| 37 | -            ->write('$footerType = $footerType ? $footerType : \'footer\';' . PHP_EOL) | 
                                                        |
| 36 | +            ->raw(';'.PHP_EOL) | 
                                                        |
| 37 | +            ->write('$footerType = $footerType ? $footerType : \'footer\';'.PHP_EOL) | 
                                                        |
| 38 | 38 |              ->write('$footerProperties = ') | 
                                                        
| 39 | 39 |              ->subcompile($this->getNode('properties')) | 
                                                        
| 40 | -            ->raw(';' . PHP_EOL) | 
                                                        |
| 41 | -            ->write('$phpExcel->startHeaderFooter($footerType, $footerProperties);' . PHP_EOL) | 
                                                        |
| 42 | -            ->write('unset($footerType, $footerProperties);' . PHP_EOL) | 
                                                        |
| 40 | +            ->raw(';'.PHP_EOL) | 
                                                        |
| 41 | +            ->write('$phpExcel->startHeaderFooter($footerType, $footerProperties);'.PHP_EOL) | 
                                                        |
| 42 | +            ->write('unset($footerType, $footerProperties);'.PHP_EOL) | 
                                                        |
| 43 | 43 |              ->subcompile($this->getNode('body')) | 
                                                        
| 44 | 44 | ->addDebugInfo($this)  | 
                                                        
| 45 | -            ->write('$phpExcel->endHeaderFooter();' . PHP_EOL); | 
                                                        |
| 45 | +            ->write('$phpExcel->endHeaderFooter();'.PHP_EOL); | 
                                                        |
| 46 | 46 | }  | 
                                                        
| 47 | 47 | }  |