Failed Conditions
Pull Request — experimental/3.1 (#2531)
by Kiyotaka
35:28
created
src/Eccube/ServiceProvider/EccubeServiceProvider.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function register(Container $app)
65 65
     {
66
-        $app[BaseInfo::class] = function () use ($app) {
66
+        $app[BaseInfo::class] = function() use ($app) {
67 67
             return $app[BaseInfoRepository::class]->get();
68 68
         };
69 69
 
70
-        $app['eccube.calculate.context'] = function () use ($app) {
70
+        $app['eccube.calculate.context'] = function() use ($app) {
71 71
                 return new \Eccube\Service\Calculator\CalculateContext();
72 72
         };
73 73
 
74
-        $app['eccube.calculate.strategies'] = function () use ($app) {
74
+        $app['eccube.calculate.strategies'] = function() use ($app) {
75 75
             $Collection = new \Eccube\Service\Calculator\CalculateStrategyCollection();
76 76
             $Collection->setApplication($app);
77 77
             //$Collection->setOrder($Order);
@@ -84,47 +84,47 @@  discard block
 block discarded – undo
84 84
             $Collection->add($app['eccube.calculate.strategy.calculate_total']);
85 85
             return $Collection;
86 86
         };
87
-        $app['eccube.calculate.strategy.shipping'] = function () use ($app) {
87
+        $app['eccube.calculate.strategy.shipping'] = function() use ($app) {
88 88
                 $Strategy = new \Eccube\Service\Calculator\Strategy\ShippingStrategy();
89 89
                 $Strategy->setApplication($app);
90 90
                 return $Strategy;
91 91
         };
92
-        $app['eccube.calculate.strategy.charge'] = function () use ($app) {
92
+        $app['eccube.calculate.strategy.charge'] = function() use ($app) {
93 93
                 $Strategy = new \Eccube\Service\Calculator\Strategy\ChargeStrategy();
94 94
                 $Strategy->setApplication($app);
95 95
                 return $Strategy;
96 96
         };
97 97
 
98
-        $app['eccube.calculate.strategy.tax'] = function () use ($app) {
98
+        $app['eccube.calculate.strategy.tax'] = function() use ($app) {
99 99
                 $Strategy = new \Eccube\Service\Calculator\Strategy\TaxStrategy();
100 100
                 $Strategy->setApplication($app);
101 101
                 return $Strategy;
102 102
         };
103 103
 
104
-        $app['eccube.calculate.strategy.calculate_delivery_fee'] = function () use ($app) {
104
+        $app['eccube.calculate.strategy.calculate_delivery_fee'] = function() use ($app) {
105 105
             $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateDeliveryFeeStrategy();
106 106
             $Strategy->setApplication($app);
107 107
             return $Strategy;
108 108
         };
109
-        $app['eccube.calculate.strategy.calculate_charge'] = function () use ($app) {
109
+        $app['eccube.calculate.strategy.calculate_charge'] = function() use ($app) {
110 110
             $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateChargeStrategy();
111 111
             $Strategy->setApplication($app);
112 112
             return $Strategy;
113 113
         };
114
-        $app['eccube.calculate.strategy.calculate_total'] = function () use ($app) {
114
+        $app['eccube.calculate.strategy.calculate_total'] = function() use ($app) {
115 115
             $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateTotalStrategy();
116 116
             $Strategy->setApplication($app);
117 117
             return $Strategy;
118 118
         };
119 119
 
120
-        $app['payment.method'] = $app->protect(function ($clazz, $form) use ($app) {
120
+        $app['payment.method'] = $app->protect(function($clazz, $form) use ($app) {
121 121
                 $PaymentMethod = new $clazz;
122 122
                 $PaymentMethod->setApplication($app);
123 123
                 $PaymentMethod->setFormType($form);
124 124
                 return $PaymentMethod;
125 125
         });
126 126
 
127
-        $app['payment.method.request'] = $app->protect(function ($clazz, $form, $request) use ($app) {
127
+        $app['payment.method.request'] = $app->protect(function($clazz, $form, $request) use ($app) {
128 128
                 $PaymentMethod = new $clazz;
129 129
                 $PaymentMethod->setApplication($app);
130 130
                 $PaymentMethod->setFormType($form);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 return $PaymentMethod;
133 133
         });
134 134
 
135
-        $app['eccube.service.calculate'] = $app->protect(function ($Order, $Customer) use ($app) {
135
+        $app['eccube.service.calculate'] = $app->protect(function($Order, $Customer) use ($app) {
136 136
             $Service = new \Eccube\Service\CalculateService($Order, $Customer);
137 137
             $Context = $app['eccube.calculate.context'];
138 138
             $app['eccube.calculate.strategies']->setOrder($Order);
@@ -143,24 +143,24 @@  discard block
 block discarded – undo
143 143
             return $Service;
144 144
         });
145 145
 
146
-        $app['eccube.service.payment'] = $app->protect(function ($clazz) use ($app) {
146
+        $app['eccube.service.payment'] = $app->protect(function($clazz) use ($app) {
147 147
             $Service = new $clazz($app['request_stack']);
148 148
 
149 149
             return $Service;
150 150
         });
151 151
 
152
-        $app['paginator'] = $app->protect(function () {
152
+        $app['paginator'] = $app->protect(function() {
153 153
             $paginator = new \Knp\Component\Pager\Paginator();
154 154
             $paginator->subscribe(new \Eccube\EventListener\PaginatorListener());
155 155
 
156 156
             return $paginator;
157 157
         });
158 158
 
159
-        $app['request_scope'] = function () {
159
+        $app['request_scope'] = function() {
160 160
             return new ParameterBag();
161 161
         };
162 162
         // TODO 使用するか検討
163
-        $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) {
163
+        $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) {
164 164
             $compiler
165 165
             ->addDebugInfo($node)
166 166
             ->write("echo 'Helloooooo ' . ")
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
         });
172 172
         // TODO 使用するか検討
173
-        $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) {
173
+        $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) {
174 174
             $compiler
175 175
             ->addDebugInfo($node)
176 176
             ->write("echo 'jirooooooo ' . ")
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         });
182 182
 
183 183
         // TODO 使用するか検討
184
-        $app['eccube.twig.generic_node_names'] = function () use ($app) {
184
+        $app['eccube.twig.generic_node_names'] = function() use ($app) {
185 185
             return [
186 186
                 'hello',
187 187
                 'jiro',
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         };
191 191
 
192 192
         // TODO 使用するか検討
193
-        $app['twig_parsers'] = function () use ($app) {
193
+        $app['twig_parsers'] = function() use ($app) {
194 194
             $GenericTokenParsers = [];
195 195
             foreach ($app['eccube.twig.generic_node_names'] as $tagName) {
196 196
                 $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName);
@@ -198,22 +198,22 @@  discard block
 block discarded – undo
198 198
             return $GenericTokenParsers;
199 199
         };
200 200
 
201
-        $app['eccube.twig.block.templates'] = function () {
201
+        $app['eccube.twig.block.templates'] = function() {
202 202
             $templates = new ArrayCollection();
203 203
             $templates[] = 'render_block.twig';
204 204
 
205 205
             return $templates;
206 206
         };
207 207
 
208
-        $app['eccube.queries'] = function () {
208
+        $app['eccube.queries'] = function() {
209 209
             return new \Eccube\Doctrine\Query\Queries();
210 210
         };
211 211
 
212
-        $app['eccube.purchase.context'] = $app->protect(function (ItemHolderInterface $origin = null) {
212
+        $app['eccube.purchase.context'] = $app->protect(function(ItemHolderInterface $origin = null) {
213 213
             return new PurchaseContext($origin);
214 214
         });
215 215
 
216
-        $app['eccube.purchase.flow.cart.item_processors'] = function ($app) {
216
+        $app['eccube.purchase.flow.cart.item_processors'] = function($app) {
217 217
             $processors = new ArrayCollection();
218 218
             $processors->add(new DisplayStatusValidator());
219 219
             $processors->add(new SaleLimitValidator());
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             return $processors;
223 223
         };
224 224
 
225
-        $app['eccube.purchase.flow.cart.holder_processors'] = function ($app) {
225
+        $app['eccube.purchase.flow.cart.holder_processors'] = function($app) {
226 226
             $processors = new ArrayCollection();
227 227
             $processors->add(new PaymentProcessor($app[DeliveryRepository::class]));
228 228
             $processors->add(new PaymentTotalLimitValidator($app['config']['max_total_fee']));
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
         };
234 234
 
235 235
         // example
236
-        $app->extend('eccube.purchase.flow.cart.item_processors', function ($processors, $app) {
236
+        $app->extend('eccube.purchase.flow.cart.item_processors', function($processors, $app) {
237 237
 
238 238
             $processors->add(new StockValidator());
239 239
 
240 240
             return $processors;
241 241
         });
242 242
 
243
-        $app['eccube.purchase.flow.cart'] = function ($app) {
243
+        $app['eccube.purchase.flow.cart'] = function($app) {
244 244
             $flow = new PurchaseFlow();
245 245
             $flow->setItemProcessors($app['eccube.purchase.flow.cart.item_processors']);
246 246
             $flow->setItemHolderProcessors($app['eccube.purchase.flow.cart.holder_processors']);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             return $flow;
249 249
         };
250 250
 
251
-        $app['eccube.purchase.flow.shopping'] = function () use ($app) {
251
+        $app['eccube.purchase.flow.shopping'] = function() use ($app) {
252 252
             $flow = new PurchaseFlow();
253 253
             $flow->addItemProcessor(new StockValidator());
254 254
             $flow->addItemProcessor(new DisplayStatusValidator());
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
             return $flow;
259 259
         };
260 260
 
261
-        $app['eccube.purchase.flow.order'] = function () use ($app) {
261
+        $app['eccube.purchase.flow.order'] = function() use ($app) {
262 262
             $flow = new PurchaseFlow();
263 263
             $flow->addItemProcessor(new StockValidator());
264 264
             $flow->addItemHolderProcessor(new PaymentTotalLimitValidator($app['config']['max_total_fee']));
Please login to merge, or discard this patch.
src/Eccube/Service/PluginService.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,6 @@
 block discarded – undo
31 31
 use Eccube\Common\Constant;
32 32
 use Eccube\Entity\Plugin;
33 33
 use Eccube\Exception\PluginException;
34
-use Eccube\Plugin\ConfigManager;
35 34
 use Eccube\Plugin\ConfigManager as PluginConfigManager;
36 35
 use Eccube\Repository\PluginEventHandlerRepository;
37 36
 use Eccube\Repository\PluginRepository;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             if (!empty($config_cache)) {
175 175
                 $meta = $config_cache;
176 176
             } else {
177
-                $meta = $this->readYml($dir . '/config.yml');
177
+                $meta = $this->readYml($dir.'/config.yml');
178 178
             }
179 179
         } catch (\Symfony\Component\Yaml\Exception\ParseException $e) {
180 180
             throw new PluginException($e->getMessage(), $e->getCode(), $e);
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
             $enabledPluginEntityDirs[] = $entityDir;
358 358
         } else {
359 359
             $index = array_search($entityDir, $enabledPluginEntityDirs);
360
-            if ($index >=0 ) {
360
+            if ($index >= 0) {
361 361
                 array_splice($enabledPluginEntityDirs, $index, 1);
362 362
             }
363 363
         }
Please login to merge, or discard this patch.
src/Eccube/Doctrine/ORM/Mapping/Driver/ReloadSafeAnnotationDriver.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         }
73 73
 
74 74
         foreach ($this->paths as $path) {
75
-            if ( ! is_dir($path)) {
75
+            if (!is_dir($path)) {
76 76
                 throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
77 77
             }
78 78
 
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
                     new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
82 82
                     \RecursiveIteratorIterator::LEAVES_ONLY
83 83
                 ),
84
-                '/^.+' . preg_quote($this->fileExtension) . '$/i',
84
+                '/^.+'.preg_quote($this->fileExtension).'$/i',
85 85
                 \RecursiveRegexIterator::GET_MATCH
86 86
             );
87 87
 
88 88
             foreach ($iterator as $file) {
89 89
                 $sourceFile = $file[0];
90 90
 
91
-                if ( ! preg_match('(^phar:)i', $sourceFile)) {
91
+                if (!preg_match('(^phar:)i', $sourceFile)) {
92 92
                     $sourceFile = realpath($sourceFile);
93 93
                 }
94 94
 
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
                     $namespaceEndIndex = $tokens->getNextTokenOfKind($namespaceIndex, [';']);
134 134
                     $namespace = $tokens->generatePartialCode($tokens->getNextMeaningfulToken($namespaceIndex), $tokens->getPrevMeaningfulToken($namespaceEndIndex));
135 135
                     $className = $tokens[$classNameTokenIndex]->getContent();
136
-                    $fqcn = $namespace . '\\' . $className;
137
-                    if (class_exists($fqcn) && ! $this->isTransient($fqcn)) {
136
+                    $fqcn = $namespace.'\\'.$className;
137
+                    if (class_exists($fqcn) && !$this->isTransient($fqcn)) {
138 138
                         if (in_array($sourceFile, $this->newProxyFiles)) {
139
-                            $newClassName = $className . Str::random(12);
139
+                            $newClassName = $className.Str::random(12);
140 140
                             $tokens[$classNameTokenIndex] = new Token([T_STRING, $newClassName]);
141 141
                             $newFilePath = $this->outputDir."${newClassName}.php";
142 142
                             file_put_contents($newFilePath, $tokens->generateCode());
143 143
                             require_once $newFilePath;
144
-                            $results[] = $namespace . "\\${newClassName}";
144
+                            $results[] = $namespace."\\${newClassName}";
145 145
                         } else {
146 146
                             $results[] = $fqcn;
147 147
                         }
Please login to merge, or discard this patch.
src/Eccube/Service/SchemaService.php 1 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
     public function updateSchema($generatedFiles)
46 46
     {
47
-        $outputDir = sys_get_temp_dir() . '/proxy_' . Str::random(12);
47
+        $outputDir = sys_get_temp_dir().'/proxy_'.Str::random(12);
48 48
         mkdir($outputDir);
49 49
 
50 50
         try {
Please login to merge, or discard this patch.