Completed
Push — master ( 5f3c96...974b7f )
by Mewes
02:23
created
DependencyInjection/MewesKTwigExcelExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
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']);
Please login to merge, or discard this patch.
Tests/Functional/AppKernel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Tests/Functional/AbstractControllerTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
         $source = static::$client->getResponse()->getContent();
46 46
 
47 47
         // create source directory if necessary
48
-        if (!file_exists(__DIR__ . static::$TEMP_PATH)) {
49
-            mkdir(__DIR__ . static::$TEMP_PATH);
48
+        if (!file_exists(__DIR__.static::$TEMP_PATH)) {
49
+            mkdir(__DIR__.static::$TEMP_PATH);
50 50
         }
51 51
 
52 52
         // save source
53
-        file_put_contents(__DIR__ . static::$TEMP_PATH . 'simple' . '.' . $format, $source);
53
+        file_put_contents(__DIR__.static::$TEMP_PATH.'simple'.'.'.$format, $source);
54 54
 
55 55
         // load source
56 56
         switch ($format) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 throw new InvalidArgumentException();
68 68
         }
69 69
 
70
-        return $reader->load(__DIR__ . static::$TEMP_PATH . 'simple' . '.' . $format);
70
+        return $reader->load(__DIR__.static::$TEMP_PATH.'simple'.'.'.$format);
71 71
     }
72 72
 
73 73
     //
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
     {
87 87
         try {
88 88
             $fs = new Filesystem();
89
-            $fs->remove(__DIR__ . static::$TEMP_PATH);
90
-        } catch(\Exception $e) {
89
+            $fs->remove(__DIR__.static::$TEMP_PATH);
90
+        } catch (\Exception $e) {
91 91
             if (!in_array(getenv('IGNORE_DELETE_EXCEPTIONS'), ['true', '1', 1, true], true)) {
92 92
                 throw $e;
93 93
             }
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
         if (in_array(getenv('DELETE_TEMP_FILES'), ['true', '1', 1, true], true)) {
106 106
             try {
107 107
                 $fs = new Filesystem();
108
-                $fs->remove(__DIR__ . static::$TEMP_PATH);
109
-            } catch(\Exception $e) {
108
+                $fs->remove(__DIR__.static::$TEMP_PATH);
109
+            } catch (\Exception $e) {
110 110
                 if (!in_array(getenv('IGNORE_DELETE_EXCEPTIONS'), ['true', '1', 1, true], true)) {
111 111
                     throw $e;
112 112
                 }
Please login to merge, or discard this patch.
Tests/Functional/TestBundle/Controller/DefaultController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public function defaultAction($templateName)
22 22
     {
23 23
         return $this->render(
24
-            '@Test/Default/' . $templateName . '.twig',
24
+            '@Test/Default/'.$templateName.'.twig',
25 25
             [
26 26
                 'data' => [
27 27
                     ['name' => 'Everette Grim', 'salary' => 5458.0],
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $response = new Response(
60 60
             $this->render(
61
-                '@Test/Default/' . $templateName . '.twig',
61
+                '@Test/Default/'.$templateName.'.twig',
62 62
                 [
63 63
                     'data' => [
64 64
                         ['name' => 'Everette Grim', 'salary' => 5458.0],
Please login to merge, or discard this patch.
Wrapper/XlsDocumentWrapper.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
             $format = $this->attributes['format'];
141 141
         }
142 142
 
143
-         // try Symfony request
143
+            // try Symfony request
144 144
         else if (array_key_exists('app', $this->context)) {
145 145
             /**
146 146
              * @var $appVariable AppVariable
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -48,58 +48,58 @@
 block discarded – undo
48 48
 
49 49
     protected function initializeMappings()
50 50
     {
51
-        $this->mappings['category'] = function ($value) {
51
+        $this->mappings['category'] = function($value) {
52 52
             $this->object->getProperties()->setCategory($value);
53 53
         };
54
-        $this->mappings['company'] = function ($value) {
54
+        $this->mappings['company'] = function($value) {
55 55
             $this->object->getProperties()->setCompany($value);
56 56
         };
57
-        $this->mappings['created'] = function ($value) {
57
+        $this->mappings['created'] = function($value) {
58 58
             $this->object->getProperties()->setCreated($value);
59 59
         };
60
-        $this->mappings['creator'] = function ($value) {
60
+        $this->mappings['creator'] = function($value) {
61 61
             $this->object->getProperties()->setCreator($value);
62 62
         };
63
-        $this->mappings['defaultStyle'] = function ($value) {
63
+        $this->mappings['defaultStyle'] = function($value) {
64 64
             $this->object->getDefaultStyle()->applyFromArray($value);
65 65
         };
66
-        $this->mappings['description'] = function ($value) {
66
+        $this->mappings['description'] = function($value) {
67 67
             $this->object->getProperties()->setDescription($value);
68 68
         };
69
-        $this->mappings['format'] = function ($value) {
69
+        $this->mappings['format'] = function($value) {
70 70
             $this->attributes['format'] = $value;
71 71
         };
72
-        $this->mappings['keywords'] = function ($value) {
72
+        $this->mappings['keywords'] = function($value) {
73 73
             $this->object->getProperties()->setKeywords($value);
74 74
         };
75
-        $this->mappings['lastModifiedBy'] = function ($value) {
75
+        $this->mappings['lastModifiedBy'] = function($value) {
76 76
             $this->object->getProperties()->setLastModifiedBy($value);
77 77
         };
78
-        $this->mappings['manager'] = function ($value) {
78
+        $this->mappings['manager'] = function($value) {
79 79
             $this->object->getProperties()->setManager($value);
80 80
         };
81
-        $this->mappings['modified'] = function ($value) {
81
+        $this->mappings['modified'] = function($value) {
82 82
             $this->object->getProperties()->setModified($value);
83 83
         };
84
-        $this->mappings['security']['lockRevision'] = function ($value) {
84
+        $this->mappings['security']['lockRevision'] = function($value) {
85 85
             $this->object->getSecurity()->setLockRevision($value);
86 86
         };
87
-        $this->mappings['security']['lockStructure'] = function ($value) {
87
+        $this->mappings['security']['lockStructure'] = function($value) {
88 88
             $this->object->getSecurity()->setLockStructure($value);
89 89
         };
90
-        $this->mappings['security']['lockWindows'] = function ($value) {
90
+        $this->mappings['security']['lockWindows'] = function($value) {
91 91
             $this->object->getSecurity()->setLockWindows($value);
92 92
         };
93
-        $this->mappings['security']['revisionsPassword'] = function ($value) {
93
+        $this->mappings['security']['revisionsPassword'] = function($value) {
94 94
             $this->object->getSecurity()->setRevisionsPassword($value);
95 95
         };
96
-        $this->mappings['security']['workbookPassword'] = function ($value) {
96
+        $this->mappings['security']['workbookPassword'] = function($value) {
97 97
             $this->object->getSecurity()->setWorkbookPassword($value);
98 98
         };
99
-        $this->mappings['subject'] = function ($value) {
99
+        $this->mappings['subject'] = function($value) {
100 100
             $this->object->getProperties()->setSubject($value);
101 101
         };
102
-        $this->mappings['title'] = function ($value) {
102
+        $this->mappings['title'] = function($value) {
103 103
             $this->object->getProperties()->setTitle($value);
104 104
         };
105 105
     }
Please login to merge, or discard this patch.
Braces   +36 added lines, -18 removed lines patch added patch discarded remove patch
@@ -48,58 +48,76 @@
 block discarded – undo
48 48
 
49 49
     protected function initializeMappings()
50 50
     {
51
-        $this->mappings['category'] = function ($value) {
51
+        $this->mappings['category'] = function ($value)
52
+        {
52 53
             $this->object->getProperties()->setCategory($value);
53 54
         };
54
-        $this->mappings['company'] = function ($value) {
55
+        $this->mappings['company'] = function ($value)
56
+        {
55 57
             $this->object->getProperties()->setCompany($value);
56 58
         };
57
-        $this->mappings['created'] = function ($value) {
59
+        $this->mappings['created'] = function ($value)
60
+        {
58 61
             $this->object->getProperties()->setCreated($value);
59 62
         };
60
-        $this->mappings['creator'] = function ($value) {
63
+        $this->mappings['creator'] = function ($value)
64
+        {
61 65
             $this->object->getProperties()->setCreator($value);
62 66
         };
63
-        $this->mappings['defaultStyle'] = function ($value) {
67
+        $this->mappings['defaultStyle'] = function ($value)
68
+        {
64 69
             $this->object->getDefaultStyle()->applyFromArray($value);
65 70
         };
66
-        $this->mappings['description'] = function ($value) {
71
+        $this->mappings['description'] = function ($value)
72
+        {
67 73
             $this->object->getProperties()->setDescription($value);
68 74
         };
69
-        $this->mappings['format'] = function ($value) {
75
+        $this->mappings['format'] = function ($value)
76
+        {
70 77
             $this->attributes['format'] = $value;
71 78
         };
72
-        $this->mappings['keywords'] = function ($value) {
79
+        $this->mappings['keywords'] = function ($value)
80
+        {
73 81
             $this->object->getProperties()->setKeywords($value);
74 82
         };
75
-        $this->mappings['lastModifiedBy'] = function ($value) {
83
+        $this->mappings['lastModifiedBy'] = function ($value)
84
+        {
76 85
             $this->object->getProperties()->setLastModifiedBy($value);
77 86
         };
78
-        $this->mappings['manager'] = function ($value) {
87
+        $this->mappings['manager'] = function ($value)
88
+        {
79 89
             $this->object->getProperties()->setManager($value);
80 90
         };
81
-        $this->mappings['modified'] = function ($value) {
91
+        $this->mappings['modified'] = function ($value)
92
+        {
82 93
             $this->object->getProperties()->setModified($value);
83 94
         };
84
-        $this->mappings['security']['lockRevision'] = function ($value) {
95
+        $this->mappings['security']['lockRevision'] = function ($value)
96
+        {
85 97
             $this->object->getSecurity()->setLockRevision($value);
86 98
         };
87
-        $this->mappings['security']['lockStructure'] = function ($value) {
99
+        $this->mappings['security']['lockStructure'] = function ($value)
100
+        {
88 101
             $this->object->getSecurity()->setLockStructure($value);
89 102
         };
90
-        $this->mappings['security']['lockWindows'] = function ($value) {
103
+        $this->mappings['security']['lockWindows'] = function ($value)
104
+        {
91 105
             $this->object->getSecurity()->setLockWindows($value);
92 106
         };
93
-        $this->mappings['security']['revisionsPassword'] = function ($value) {
107
+        $this->mappings['security']['revisionsPassword'] = function ($value)
108
+        {
94 109
             $this->object->getSecurity()->setRevisionsPassword($value);
95 110
         };
96
-        $this->mappings['security']['workbookPassword'] = function ($value) {
111
+        $this->mappings['security']['workbookPassword'] = function ($value)
112
+        {
97 113
             $this->object->getSecurity()->setWorkbookPassword($value);
98 114
         };
99
-        $this->mappings['subject'] = function ($value) {
115
+        $this->mappings['subject'] = function ($value)
116
+        {
100 117
             $this->object->getProperties()->setSubject($value);
101 118
         };
102
-        $this->mappings['title'] = function ($value) {
119
+        $this->mappings['title'] = function ($value)
120
+        {
103 121
             $this->object->getProperties()->setTitle($value);
104 122
         };
105 123
     }
Please login to merge, or discard this patch.
Tests/Twig/AbstractTwigTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
         $appVariable->setRequestStack($requestStack);
52 52
 
53 53
         // generate source from template
54
-        $source = static::$environment->loadTemplate($templateName . '.twig')->render(['app' => $appVariable]);
54
+        $source = static::$environment->loadTemplate($templateName.'.twig')->render(['app' => $appVariable]);
55 55
 
56 56
         // create paths
57
-        $tempDirPath = __DIR__ . static::$TEMP_PATH;
58
-        $tempFilePath = $tempDirPath . $templateName . '.' . $format;
57
+        $tempDirPath = __DIR__.static::$TEMP_PATH;
58
+        $tempFilePath = $tempDirPath.$templateName.'.'.$format;
59 59
 
60 60
         // create source directory if necessary
61 61
         if (!file_exists($tempDirPath)) {
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public static function setUpBeforeClass()
102 102
     {
103
-        static::$environment = new Twig_Environment(new Twig_Loader_Filesystem(__DIR__ . static::$RESOURCE_PATH), ['strict_variables' => true]);
103
+        static::$environment = new Twig_Environment(new Twig_Loader_Filesystem(__DIR__.static::$RESOURCE_PATH), ['strict_variables' => true]);
104 104
         static::$environment->addExtension(new TwigExcelExtension());
105
-        static::$environment->setCache(__DIR__ . static::$TEMP_PATH);
105
+        static::$environment->setCache(__DIR__.static::$TEMP_PATH);
106 106
     }
107 107
 
108 108
     /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     public static function tearDownAfterClass()
112 112
     {
113 113
         if (in_array(getenv('DELETE_TEMP_FILES'), ['true', '1', 1, true], true)) {
114
-            exec('rm -rf ' . __DIR__ . static::$TEMP_PATH);
114
+            exec('rm -rf '.__DIR__.static::$TEMP_PATH);
115 115
         }
116 116
     }
117 117
 }
Please login to merge, or discard this patch.
Twig/Node/XlsCellNode.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@
 block discarded – undo
33 33
         $compiler->addDebugInfo($this)
34 34
             ->write('$context[\'phpExcel\']->setCellIndex(')
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('$context[\'phpExcel\']->startCell($cellValue, $cellProperties);' . PHP_EOL)
44
-            ->write('unset($cellIndex, $cellValue, $cellProperties);' . PHP_EOL)
45
-            ->write('$context[\'phpExcel\']->endCell();' . PHP_EOL);
42
+            ->raw(';'.PHP_EOL)
43
+            ->write('$context[\'phpExcel\']->startCell($cellValue, $cellProperties);'.PHP_EOL)
44
+            ->write('unset($cellIndex, $cellValue, $cellProperties);'.PHP_EOL)
45
+            ->write('$context[\'phpExcel\']->endCell();'.PHP_EOL);
46 46
     }
47 47
 
48 48
     /**
Please login to merge, or discard this patch.
Twig/Node/XlsCenterNode.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(\'center\');' . PHP_EOL)
31
+            ->write('$context[\'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('$context[\'phpExcel\']->endAlignment($centerValue);' . PHP_EOL)
36
-            ->write('unset($centerValue);' . PHP_EOL);
34
+            ->write('$centerValue = trim(ob_get_clean());'.PHP_EOL)
35
+            ->write('$context[\'phpExcel\']->endAlignment($centerValue);'.PHP_EOL)
36
+            ->write('unset($centerValue);'.PHP_EOL);
37 37
     }
38 38
 
39 39
     /**
Please login to merge, or discard this patch.
Twig/Node/XlsDocumentNode.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,16 +45,16 @@
 block discarded – undo
45 45
         $compiler->addDebugInfo($this)
46 46
             ->write('$documentProperties = ')
47 47
             ->subcompile($this->getNode('properties'))
48
-            ->raw(';' . PHP_EOL)
49
-            ->write('$context[\'phpExcel\'] = new MewesK\TwigExcelBundle\Wrapper\PhpExcelWrapper($context);' . PHP_EOL)
50
-            ->write('$context[\'phpExcel\']->startDocument($documentProperties);' . PHP_EOL)
51
-            ->write('unset($documentProperties);' . PHP_EOL)
48
+            ->raw(';'.PHP_EOL)
49
+            ->write('$context[\'phpExcel\'] = new MewesK\TwigExcelBundle\Wrapper\PhpExcelWrapper($context);'.PHP_EOL)
50
+            ->write('$context[\'phpExcel\']->startDocument($documentProperties);'.PHP_EOL)
51
+            ->write('unset($documentProperties);'.PHP_EOL)
52 52
             ->subcompile($this->getNode('body'))
53 53
             ->addDebugInfo($this)
54
-            ->write('$context[\'phpExcel\']->endDocument(' .
55
-                ($this->preCalculateFormulas ? 'true' : 'false') . ', ' .
56
-                ($this->diskCachingDirectory ? '\'' . $this->diskCachingDirectory . '\'' : 'null') . ');' . PHP_EOL)
57
-            ->write('unset($context[\'phpExcel\']);' . PHP_EOL);
54
+            ->write('$context[\'phpExcel\']->endDocument('.
55
+                ($this->preCalculateFormulas ? 'true' : 'false').', '.
56
+                ($this->diskCachingDirectory ? '\''.$this->diskCachingDirectory.'\'' : 'null').');'.PHP_EOL)
57
+            ->write('unset($context[\'phpExcel\']);'.PHP_EOL);
58 58
     }
59 59
 
60 60
     /**
Please login to merge, or discard this patch.