Completed
Pull Request — master (#12)
by
unknown
02:37
created
Twig/Node/XlsLeftNode.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@
 block discarded – undo
28 28
     public function compile(Twig_Compiler $compiler)
29 29
     {
30 30
         $compiler->addDebugInfo($this)
31
-            ->write('$context[\'phpExcel\']->startAlignment(\'left\');' . PHP_EOL)
31
+            ->write('$context[\'phpExcel\']->startAlignment(\'left\');'.PHP_EOL)
32 32
             ->write("ob_start();\n")
33 33
             ->subcompile($this->getNode('body'))
34
-            ->write('$leftValue = trim(ob_get_clean());' . PHP_EOL)
35
-            ->write('$context[\'phpExcel\']->endAlignment($leftValue);' . PHP_EOL)
36
-            ->write('unset($leftValue);' . PHP_EOL);
34
+            ->write('$leftValue = trim(ob_get_clean());'.PHP_EOL)
35
+            ->write('$context[\'phpExcel\']->endAlignment($leftValue);'.PHP_EOL)
36
+            ->write('unset($leftValue);'.PHP_EOL);
37 37
     }
38 38
 
39 39
     /**
Please login to merge, or discard this patch.
Twig/Node/XlsRightNode.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@
 block discarded – undo
28 28
     public function compile(Twig_Compiler $compiler)
29 29
     {
30 30
         $compiler->addDebugInfo($this)
31
-            ->write('$context[\'phpExcel\']->startAlignment(\'right\');' . PHP_EOL)
31
+            ->write('$context[\'phpExcel\']->startAlignment(\'right\');'.PHP_EOL)
32 32
             ->write("ob_start();\n")
33 33
             ->subcompile($this->getNode('body'))
34
-            ->write('$rightValue = trim(ob_get_clean());' . PHP_EOL)
35
-            ->write('$context[\'phpExcel\']->endAlignment($rightValue);' . PHP_EOL)
36
-            ->write('unset($rightValue);' . PHP_EOL);
34
+            ->write('$rightValue = trim(ob_get_clean());'.PHP_EOL)
35
+            ->write('$context[\'phpExcel\']->endAlignment($rightValue);'.PHP_EOL)
36
+            ->write('unset($rightValue);'.PHP_EOL);
37 37
     }
38 38
 
39 39
     /**
Please login to merge, or discard this patch.
Twig/Node/XlsRowNode.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@
 block discarded – undo
32 32
         $compiler->addDebugInfo($this)
33 33
             ->write('$context[\'phpExcel\']->setRowIndex(')
34 34
             ->subcompile($this->getNode('index'))
35
-            ->raw(');' . PHP_EOL)
36
-            ->write('$context[\'phpExcel\']->startRow($context[\'phpExcel\']->getRowIndex());' . PHP_EOL)
37
-            ->write('$context[\'phpExcel\']->setRowIndex(0);' . PHP_EOL)
35
+            ->raw(');'.PHP_EOL)
36
+            ->write('$context[\'phpExcel\']->startRow($context[\'phpExcel\']->getRowIndex());'.PHP_EOL)
37
+            ->write('$context[\'phpExcel\']->setRowIndex(0);'.PHP_EOL)
38 38
             ->subcompile($this->getNode('body'))
39 39
             ->addDebugInfo($this)
40
-            ->write('$context[\'phpExcel\']->endRow();' . PHP_EOL);
40
+            ->write('$context[\'phpExcel\']->endRow();'.PHP_EOL);
41 41
     }
42 42
 
43 43
     /**
Please login to merge, or discard this patch.
Twig/Node/XlsSheetNode.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
         $compiler->addDebugInfo($this)
34 34
             ->write('$sheetIndex = ')
35 35
             ->subcompile($this->getNode('index'))
36
-            ->raw(';' . PHP_EOL)
36
+            ->raw(';'.PHP_EOL)
37 37
             ->write('$sheetProperties = ')
38 38
             ->subcompile($this->getNode('properties'))
39
-            ->raw(';' . PHP_EOL)
40
-            ->write('$context[\'phpExcel\']->startSheet($sheetIndex, $sheetProperties);' . PHP_EOL)
41
-            ->write('unset($sheetIndex, $sheetProperties);' . PHP_EOL);
39
+            ->raw(';'.PHP_EOL)
40
+            ->write('$context[\'phpExcel\']->startSheet($sheetIndex, $sheetProperties);'.PHP_EOL)
41
+            ->write('unset($sheetIndex, $sheetProperties);'.PHP_EOL);
42 42
 
43 43
         if ($this->hasNode('body')) {
44 44
             $compiler->subcompile($this->getNode('body'));
45 45
         }
46 46
 
47
-        $compiler->addDebugInfo($this)->write('$context[\'phpExcel\']->endSheet();' . PHP_EOL);
47
+        $compiler->addDebugInfo($this)->write('$context[\'phpExcel\']->endSheet();'.PHP_EOL);
48 48
     }
49 49
 
50 50
     /**
Please login to merge, or discard this patch.
Twig/NodeVisitor/SyntaxCheckNodeVisitor.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,12 +32,10 @@
 block discarded – undo
32 32
         if (($node instanceof Twig_Node_Block || $node instanceof Twig_Node_Macro) && !$node->hasAttribute('twigExcelBundle') && $this->checkContainsXlsNode($node)) {
33 33
             if ($node instanceof Twig_Node_Block) {
34 34
                 throw new Twig_Error_Syntax('Block tags do not work together with Twig tags provided by TwigExcelBundle. Please use \'xlsblock\' instead.');
35
-            }
36
-            elseif ($node instanceof Twig_Node_Macro) {
35
+            } elseif ($node instanceof Twig_Node_Macro) {
37 36
                 throw new Twig_Error_Syntax('Macro tags do not work together with Twig tags provided by TwigExcelBundle. Please use \'xlsmacro\' instead.');
38 37
             }
39
-        }
40
-        elseif ($node instanceof XlsNode) {
38
+        } elseif ($node instanceof XlsNode) {
41 39
             /**
42 40
              * @var XlsNode $node
43 41
              */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
              */
45 45
             try {
46 46
                 NodeHelper::checkAllowedParents($node, $this->path);
47
-            } catch(Twig_Error_Syntax $e) {
47
+            } catch (Twig_Error_Syntax $e) {
48 48
                 // reset path since throwing an error prevents doLeaveNode to be called
49 49
                 $this->path = [];
50 50
                 throw $e;
Please login to merge, or discard this patch.
Twig/TokenParser/AbstractTokenParser.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@
 block discarded – undo
20 20
      */
21 21
     protected function parseBody()
22 22
     {
23
-        $body = $this->parser->subparse(function (Twig_Token $token) {
24
-            return $token->test('end' . $this->getTag());
23
+        $body = $this->parser->subparse(function(Twig_Token $token) {
24
+            return $token->test('end'.$this->getTag());
25 25
         },
26 26
             true);
27 27
         $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@
 block discarded – undo
20 20
      */
21 21
     protected function parseBody()
22 22
     {
23
-        $body = $this->parser->subparse(function (Twig_Token $token) {
23
+        $body = $this->parser->subparse(function (Twig_Token $token)
24
+        {
24 25
             return $token->test('end' . $this->getTag());
25 26
         },
26 27
             true);
Please login to merge, or discard this patch.
Wrapper/XlsDrawingWrapper.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -55,52 +55,52 @@  discard block
 block discarded – undo
55 55
 
56 56
     protected function initializeMappings()
57 57
     {
58
-        $this->mappings['coordinates'] = function ($value) {
58
+        $this->mappings['coordinates'] = function($value) {
59 59
             $this->object->setCoordinates($value);
60 60
         };
61
-        $this->mappings['description'] = function ($value) {
61
+        $this->mappings['description'] = function($value) {
62 62
             $this->object->setDescription($value);
63 63
         };
64
-        $this->mappings['height'] = function ($value) {
64
+        $this->mappings['height'] = function($value) {
65 65
             $this->object->setHeight($value);
66 66
         };
67
-        $this->mappings['name'] = function ($value) {
67
+        $this->mappings['name'] = function($value) {
68 68
             $this->object->setName($value);
69 69
         };
70
-        $this->mappings['offsetX'] = function ($value) {
70
+        $this->mappings['offsetX'] = function($value) {
71 71
             $this->object->setOffsetX($value);
72 72
         };
73
-        $this->mappings['offsetY'] = function ($value) {
73
+        $this->mappings['offsetY'] = function($value) {
74 74
             $this->object->setOffsetY($value);
75 75
         };
76
-        $this->mappings['resizeProportional'] = function ($value) {
76
+        $this->mappings['resizeProportional'] = function($value) {
77 77
             $this->object->setResizeProportional($value);
78 78
         };
79
-        $this->mappings['rotation'] = function ($value) {
79
+        $this->mappings['rotation'] = function($value) {
80 80
             $this->object->setRotation($value);
81 81
         };
82
-        $this->mappings['shadow']['alignment'] = function ($value) {
82
+        $this->mappings['shadow']['alignment'] = function($value) {
83 83
             $this->object->getShadow()->setAlignment($value);
84 84
         };
85
-        $this->mappings['shadow']['alpha'] = function ($value) {
85
+        $this->mappings['shadow']['alpha'] = function($value) {
86 86
             $this->object->getShadow()->setAlpha($value);
87 87
         };
88
-        $this->mappings['shadow']['blurRadius'] = function ($value) {
88
+        $this->mappings['shadow']['blurRadius'] = function($value) {
89 89
             $this->object->getShadow()->setBlurRadius($value);
90 90
         };
91
-        $this->mappings['shadow']['color'] = function ($value) {
91
+        $this->mappings['shadow']['color'] = function($value) {
92 92
             $this->object->getShadow()->getColor()->setRGB($value);
93 93
         };
94
-        $this->mappings['shadow']['direction'] = function ($value) {
94
+        $this->mappings['shadow']['direction'] = function($value) {
95 95
             $this->object->getShadow()->setDirection($value);
96 96
         };
97
-        $this->mappings['shadow']['distance'] = function ($value) {
97
+        $this->mappings['shadow']['distance'] = function($value) {
98 98
             $this->object->getShadow()->setDistance($value);
99 99
         };
100
-        $this->mappings['shadow']['visible'] = function ($value) {
100
+        $this->mappings['shadow']['visible'] = function($value) {
101 101
             $this->object->getShadow()->setVisible($value);
102 102
         };
103
-        $this->mappings['width'] = function ($value) {
103
+        $this->mappings['width'] = function($value) {
104 104
             $this->object->setWidth($value);
105 105
         };
106 106
     }
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
     {
195 195
         // create temp path
196 196
         $pathExtension = pathinfo($path, PATHINFO_EXTENSION);
197
-        $tempPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'xlsdrawing' . '_' . md5($path) . ($pathExtension ? '.' . $pathExtension : '');
197
+        $tempPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'xlsdrawing'.'_'.md5($path).($pathExtension ? '.'.$pathExtension : '');
198 198
 
199 199
         // create local copy
200 200
         if (!file_exists($tempPath)) {
201 201
             $data = file_get_contents($path);
202 202
             if ($data === false) {
203
-                throw new \InvalidArgumentException($path . ' does not exist.');
203
+                throw new \InvalidArgumentException($path.' does not exist.');
204 204
             }
205 205
             $temp = fopen($tempPath, 'w+');
206 206
             if ($temp === false) {
207
-                throw new \RuntimeException('Cannot open ' . $tempPath);
207
+                throw new \RuntimeException('Cannot open '.$tempPath);
208 208
             }
209 209
             fwrite($temp, $data);
210 210
             if (fclose($temp) === false) {
211
-                throw new \RuntimeException('Cannot close ' . $tempPath);
211
+                throw new \RuntimeException('Cannot close '.$tempPath);
212 212
             }
213 213
             unset($data, $temp);
214 214
         }
Please login to merge, or discard this patch.
Braces   +32 added lines, -16 removed lines patch added patch discarded remove patch
@@ -55,52 +55,68 @@
 block discarded – undo
55 55
 
56 56
     protected function initializeMappings()
57 57
     {
58
-        $this->mappings['coordinates'] = function ($value) {
58
+        $this->mappings['coordinates'] = function ($value)
59
+        {
59 60
             $this->object->setCoordinates($value);
60 61
         };
61
-        $this->mappings['description'] = function ($value) {
62
+        $this->mappings['description'] = function ($value)
63
+        {
62 64
             $this->object->setDescription($value);
63 65
         };
64
-        $this->mappings['height'] = function ($value) {
66
+        $this->mappings['height'] = function ($value)
67
+        {
65 68
             $this->object->setHeight($value);
66 69
         };
67
-        $this->mappings['name'] = function ($value) {
70
+        $this->mappings['name'] = function ($value)
71
+        {
68 72
             $this->object->setName($value);
69 73
         };
70
-        $this->mappings['offsetX'] = function ($value) {
74
+        $this->mappings['offsetX'] = function ($value)
75
+        {
71 76
             $this->object->setOffsetX($value);
72 77
         };
73
-        $this->mappings['offsetY'] = function ($value) {
78
+        $this->mappings['offsetY'] = function ($value)
79
+        {
74 80
             $this->object->setOffsetY($value);
75 81
         };
76
-        $this->mappings['resizeProportional'] = function ($value) {
82
+        $this->mappings['resizeProportional'] = function ($value)
83
+        {
77 84
             $this->object->setResizeProportional($value);
78 85
         };
79
-        $this->mappings['rotation'] = function ($value) {
86
+        $this->mappings['rotation'] = function ($value)
87
+        {
80 88
             $this->object->setRotation($value);
81 89
         };
82
-        $this->mappings['shadow']['alignment'] = function ($value) {
90
+        $this->mappings['shadow']['alignment'] = function ($value)
91
+        {
83 92
             $this->object->getShadow()->setAlignment($value);
84 93
         };
85
-        $this->mappings['shadow']['alpha'] = function ($value) {
94
+        $this->mappings['shadow']['alpha'] = function ($value)
95
+        {
86 96
             $this->object->getShadow()->setAlpha($value);
87 97
         };
88
-        $this->mappings['shadow']['blurRadius'] = function ($value) {
98
+        $this->mappings['shadow']['blurRadius'] = function ($value)
99
+        {
89 100
             $this->object->getShadow()->setBlurRadius($value);
90 101
         };
91
-        $this->mappings['shadow']['color'] = function ($value) {
102
+        $this->mappings['shadow']['color'] = function ($value)
103
+        {
92 104
             $this->object->getShadow()->getColor()->setRGB($value);
93 105
         };
94
-        $this->mappings['shadow']['direction'] = function ($value) {
106
+        $this->mappings['shadow']['direction'] = function ($value)
107
+        {
95 108
             $this->object->getShadow()->setDirection($value);
96 109
         };
97
-        $this->mappings['shadow']['distance'] = function ($value) {
110
+        $this->mappings['shadow']['distance'] = function ($value)
111
+        {
98 112
             $this->object->getShadow()->setDistance($value);
99 113
         };
100
-        $this->mappings['shadow']['visible'] = function ($value) {
114
+        $this->mappings['shadow']['visible'] = function ($value)
115
+        {
101 116
             $this->object->getShadow()->setVisible($value);
102 117
         };
103
-        $this->mappings['width'] = function ($value) {
118
+        $this->mappings['width'] = function ($value)
119
+        {
104 120
             $this->object->setWidth($value);
105 121
         };
106 122
     }
Please login to merge, or discard this patch.
Wrapper/XlsHeaderFooterWrapper.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@
 block discarded – undo
56 56
 
57 57
     protected function initializeMappings()
58 58
     {
59
-        $this->mappings['scaleWithDocument'] = function ($value) {
59
+        $this->mappings['scaleWithDocument'] = function($value) {
60 60
             $this->object->setScaleWithDocument($value);
61 61
         };
62
-        $this->mappings['alignWithMargins'] = function ($value) {
62
+        $this->mappings['alignWithMargins'] = function($value) {
63 63
             $this->object->setAlignWithMargins($value);
64 64
         };
65 65
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,10 +56,12 @@
 block discarded – undo
56 56
 
57 57
     protected function initializeMappings()
58 58
     {
59
-        $this->mappings['scaleWithDocument'] = function ($value) {
59
+        $this->mappings['scaleWithDocument'] = function ($value)
60
+        {
60 61
             $this->object->setScaleWithDocument($value);
61 62
         };
62
-        $this->mappings['alignWithMargins'] = function ($value) {
63
+        $this->mappings['alignWithMargins'] = function ($value)
64
+        {
63 65
             $this->object->setAlignWithMargins($value);
64 66
         };
65 67
     }
Please login to merge, or discard this patch.
Tests/Twig/AbstractTwigTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
         $appVariable->setRequestStack($requestStack);
53 53
 
54 54
         // generate source from template
55
-        $source = static::$environment->loadTemplate($templateName . '.twig')->render(['app' => $appVariable]);
55
+        $source = static::$environment->loadTemplate($templateName.'.twig')->render(['app' => $appVariable]);
56 56
 
57 57
         // create paths
58
-        $tempDirPath = __DIR__ . static::$TEMP_PATH;
59
-        $tempFilePath = $tempDirPath . $templateName . '.' . $format;
58
+        $tempDirPath = __DIR__.static::$TEMP_PATH;
59
+        $tempFilePath = $tempDirPath.$templateName.'.'.$format;
60 60
 
61 61
         // create source directory if necessary
62 62
         if (!file_exists($tempDirPath) && !@mkdir($tempDirPath) && !@is_dir($tempDirPath)) {
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public static function setUpBeforeClass()
103 103
     {
104
-        $fileSystem = new Twig_Loader_Filesystem([__DIR__ . static::$RESOURCE_PATH]);
105
-        $fileSystem->addPath( __DIR__ . static::$TEMPLATE_PATH, 'templates');
104
+        $fileSystem = new Twig_Loader_Filesystem([__DIR__.static::$RESOURCE_PATH]);
105
+        $fileSystem->addPath(__DIR__.static::$TEMPLATE_PATH, 'templates');
106 106
         static::$environment = new Twig_Environment($fileSystem, ['strict_variables' => true]);
107 107
         static::$environment->addExtension(new TwigExcelExtension());
108
-        static::$environment->setCache(__DIR__ . static::$TEMP_PATH);
108
+        static::$environment->setCache(__DIR__.static::$TEMP_PATH);
109 109
     }
110 110
 
111 111
     /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     public static function tearDownAfterClass()
115 115
     {
116 116
         if (in_array(getenv('DELETE_TEMP_FILES'), ['true', '1', 1, true], true)) {
117
-            exec('rm -rf ' . __DIR__ . static::$TEMP_PATH);
117
+            exec('rm -rf '.__DIR__.static::$TEMP_PATH);
118 118
         }
119 119
     }
120 120
 }
Please login to merge, or discard this patch.