Failed Conditions
Pull Request — experimental/3.1 (#2512)
by chihiro
12:14
created
src/Eccube/Controller/Admin/Customer/CustomerEditController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@  discard block
 block discarded – undo
27 27
 use Eccube\Annotation\Inject;
28 28
 use Eccube\Annotation\Component;
29 29
 use Eccube\Application;
30
-use Eccube\Common\Constant;
31 30
 use Eccube\Controller\AbstractController;
32 31
 use Eccube\Entity\CustomerAddress;
33 32
 use Eccube\Event\EccubeEvents;
@@ -36,7 +35,6 @@  discard block
 block discarded – undo
36 35
 use Eccube\Repository\CustomerRepository;
37 36
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
38 37
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
39
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
40 38
 use Symfony\Component\EventDispatcher\EventDispatcher;
41 39
 use Symfony\Component\Form\FormFactory;
42 40
 use Symfony\Component\HttpFoundation\Request;
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/ProductClassController.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -603,6 +603,9 @@  discard block
 block discarded – undo
603 603
     /**
604 604
      * 登録、更新時のエラー画面表示
605 605
      *
606
+     * @param Application $app
607
+     * @param boolean $not_product_class
608
+     * @param \Symfony\Component\Form\FormInterface $classForm
606 609
      */
607 610
     protected function render($app, $Product, $ProductClass, $not_product_class, $classForm, $error = null)
608 611
     {
@@ -654,6 +657,7 @@  discard block
 block discarded – undo
654 657
 
655 658
     /**
656 659
      * 規格1と規格2を組み合わせた商品規格を作成
660
+     * @param Application $app
657 661
      */
658 662
     private function createProductClasses($app, Product $Product, ClassName $ClassName1 = null, ClassName $ClassName2 = null)
659 663
     {
@@ -741,6 +745,7 @@  discard block
 block discarded – undo
741 745
      *
742 746
      * @param $productClassDest ProductClass コピー先となる商品規格
743 747
      * @param $productClassOrig ProductClass コピー元となる商品規格
748
+     * @param Application $app
744 749
      */
745 750
     private function setDefaultProductClass($app, $productClassDest, $productClassOrig) {
746 751
         $productClassDest->setDeliveryDate($productClassOrig->getDeliveryDate());
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Setting/Shop/DeliveryController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,6 @@
 block discarded – undo
28 28
 use Eccube\Annotation\Component;
29 29
 use Eccube\Annotation\Inject;
30 30
 use Eccube\Application;
31
-use Eccube\Common\Constant;
32 31
 use Eccube\Controller\AbstractController;
33 32
 use Eccube\Entity\Delivery;
34 33
 use Eccube\Event\EccubeEvents;
Please login to merge, or discard this patch.
src/Eccube/Controller/Mypage/WithdrawController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -28,14 +28,12 @@
 block discarded – undo
28 28
 use Eccube\Annotation\Component;
29 29
 use Eccube\Annotation\Inject;
30 30
 use Eccube\Application;
31
-use Eccube\Common\Constant;
32 31
 use Eccube\Controller\AbstractController;
33 32
 use Eccube\Entity\Master\CustomerStatus;
34 33
 use Eccube\Event\EccubeEvents;
35 34
 use Eccube\Event\EventArgs;
36 35
 use Eccube\Repository\Master\CustomerStatusRepository;
37 36
 use Eccube\Service\MailService;
38
-use Eccube\Util\Str;
39 37
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
40 38
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
41 39
 use Symfony\Component\EventDispatcher\EventDispatcher;
Please login to merge, or discard this patch.
src/Eccube/Repository/CustomerRepository.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
 use Doctrine\ORM\EntityManager;
28 28
 use Eccube\Annotation\Inject;
29 29
 use Eccube\Annotation\Repository;
30
-use Eccube\Common\Constant;
31 30
 use Eccube\Doctrine\Query\Queries;
32 31
 use Eccube\Entity\Customer;
33 32
 use Eccube\Entity\Master\CustomerStatus;
Please login to merge, or discard this patch.
src/Eccube/Repository/MemberRepository.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@
 block discarded – undo
26 26
 
27 27
 use Eccube\Annotation\Repository;
28 28
 use Eccube\Annotation\Inject;
29
-use Eccube\Common\Constant;
30 29
 use Eccube\Entity\Member;
31 30
 use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
32 31
 use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
Please login to merge, or discard this patch.
src/Eccube/Service/OrderHelper.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Doctrine\ORM\EntityManager;
7 7
 use Eccube\Annotation\Inject;
8 8
 use Eccube\Annotation\Service;
9
-use Eccube\Common\Constant;
10 9
 use Eccube\Entity\CartItem;
11 10
 use Eccube\Entity\Customer;
12 11
 use Eccube\Entity\CustomerAddress;
Please login to merge, or discard this patch.
src/Eccube/ServiceProvider/EccubeServiceProvider.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\Repository\BaseInfoRepository;
32 32
 use Eccube\Repository\DeliveryRepository;
33 33
 use Eccube\Service\PurchaseFlow\Processor\AdminOrderRegisterPurchaseProcessor;
34
-use Eccube\Service\PurchaseFlow\Processor\DeletedProductValidator;
35 34
 use Eccube\Service\PurchaseFlow\Processor\DeliveryFeeFreeProcessor;
36 35
 use Eccube\Service\PurchaseFlow\Processor\DeliveryFeeProcessor;
37 36
 use Eccube\Service\PurchaseFlow\Processor\DeliverySettingValidator;
Please login to merge, or discard this 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,7 +198,7 @@  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
 
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
         };
207 207
 
208 208
         $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener());
209
-        $app['eccube.queries'] = function () {
209
+        $app['eccube.queries'] = function() {
210 210
             return new \Eccube\Doctrine\Query\Queries();
211 211
         };
212 212
         // TODO QueryCustomizerの追加方法は要検討
213 213
         $app['eccube.queries']->addCustomizer(new \Acme\Entity\AdminProductListCustomizer());
214 214
 
215
-        $app['eccube.purchase.context'] = $app->protect(function (ItemHolderInterface $origin = null) {
215
+        $app['eccube.purchase.context'] = $app->protect(function(ItemHolderInterface $origin = null) {
216 216
             return new PurchaseContext($origin);
217 217
         });
218 218
 
219
-        $app['eccube.purchase.flow.cart.item_processors'] = function ($app) {
219
+        $app['eccube.purchase.flow.cart.item_processors'] = function($app) {
220 220
             $processors = new ArrayCollection();
221 221
             $processors->add(new DisplayStatusValidator());
222 222
             $processors->add(new SaleLimitValidator());
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             return $processors;
226 226
         };
227 227
 
228
-        $app['eccube.purchase.flow.cart.holder_processors'] = function ($app) {
228
+        $app['eccube.purchase.flow.cart.holder_processors'] = function($app) {
229 229
             $processors = new ArrayCollection();
230 230
             $processors->add(new PaymentProcessor($app[DeliveryRepository::class]));
231 231
             $processors->add(new PaymentTotalLimitValidator($app['config']['max_total_fee']));
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
         };
237 237
 
238 238
         // example
239
-        $app->extend('eccube.purchase.flow.cart.item_processors', function ($processors, $app) {
239
+        $app->extend('eccube.purchase.flow.cart.item_processors', function($processors, $app) {
240 240
 
241 241
             $processors->add(new StockValidator());
242 242
 
243 243
             return $processors;
244 244
         });
245 245
 
246
-        $app['eccube.purchase.flow.cart'] = function ($app) {
246
+        $app['eccube.purchase.flow.cart'] = function($app) {
247 247
             $flow = new PurchaseFlow();
248 248
             $flow->setItemProcessors($app['eccube.purchase.flow.cart.item_processors']);
249 249
             $flow->setItemHolderProcessors($app['eccube.purchase.flow.cart.holder_processors']);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             return $flow;
252 252
         };
253 253
 
254
-        $app['eccube.purchase.flow.shopping'] = function () use ($app) {
254
+        $app['eccube.purchase.flow.shopping'] = function() use ($app) {
255 255
             $flow = new PurchaseFlow();
256 256
             $flow->addItemProcessor(new StockValidator());
257 257
             $flow->addItemProcessor(new DisplayStatusValidator());
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
             return $flow;
262 262
         };
263 263
 
264
-        $app['eccube.purchase.flow.order'] = function () use ($app) {
264
+        $app['eccube.purchase.flow.order'] = function() use ($app) {
265 265
             $flow = new PurchaseFlow();
266 266
             $flow->addItemProcessor(new StockValidator());
267 267
             $flow->addItemHolderProcessor(new PaymentTotalLimitValidator($app['config']['max_total_fee']));
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/ProductController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
                     }
321 321
 
322 322
                     $extension = $image->getClientOriginalExtension();
323
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
323
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
324 324
                     $image->move($this->appConfig['image_temp_realdir'], $filename);
325 325
                     $files[] = $filename;
326 326
                 }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
         $form = $builder->getForm();
400 400
 
401 401
         if (!$has_class) {
402
-            $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited());
402
+            $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited());
403 403
             $form['class']->setData($ProductClass);
404 404
         }
405 405
 
@@ -481,8 +481,8 @@  discard block
 block discarded – undo
481 481
                 $Categories = $form->get('Category')->getData();
482 482
                 $categoriesIdList = array();
483 483
                 foreach ($Categories as $Category) {
484
-                    foreach($Category->getPath() as $ParentCategory){
485
-                        if (!isset($categoriesIdList[$ParentCategory->getId()])){
484
+                    foreach ($Category->getPath() as $ParentCategory) {
485
+                        if (!isset($categoriesIdList[$ParentCategory->getId()])) {
486 486
                             $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count);
487 487
                             $this->entityManager->persist($ProductCategory);
488 488
                             $count++;
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
                             $categoriesIdList[$ParentCategory->getId()] = true;
492 492
                         }
493 493
                     }
494
-                    if (!isset($categoriesIdList[$Category->getId()])){
494
+                    if (!isset($categoriesIdList[$Category->getId()])) {
495 495
                         $ProductCategory = $this->createProductCategory($Product, $Category, $count);
496 496
                         $this->entityManager->persist($ProductCategory);
497 497
                         $count++;
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
                     $this->entityManager->persist($ProductImage);
514 514
 
515 515
                     // 移動
516
-                    $file = new File($this->appConfig['image_temp_realdir'] . '/' . $add_image);
516
+                    $file = new File($this->appConfig['image_temp_realdir'].'/'.$add_image);
517 517
                     $file->move($this->appConfig['image_save_realdir']);
518 518
                 }
519 519
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 
534 534
                     // 削除
535 535
                     $fs = new Filesystem();
536
-                    $fs->remove($this->appConfig['image_save_realdir'] . '/' . $delete_image);
536
+                    $fs->remove($this->appConfig['image_save_realdir'].'/'.$delete_image);
537 537
                 }
538 538
                 $this->entityManager->persist($Product);
539 539
                 $this->entityManager->flush();
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
                     foreach ($deleteImages as $deleteImage) {
669 669
                         try {
670 670
                             $fs = new Filesystem();
671
-                            $fs->remove($this->appConfig['image_save_realdir'] . '/' . $deleteImage);
671
+                            $fs->remove($this->appConfig['image_save_realdir'].'/'.$deleteImage);
672 672
                         } catch (\Exception $e) {
673 673
                             // エラーが発生しても無視する
674 674
                         }
@@ -742,10 +742,10 @@  discard block
 block discarded – undo
742 742
 
743 743
                     // 画像ファイルを新規作成
744 744
                     $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION);
745
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
745
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
746 746
                     try {
747 747
                         $fs = new Filesystem();
748
-                        $fs->copy($this->appConfig['image_save_realdir'] . '/' . $Image->getFileName(), $this->appConfig['image_save_realdir'] . '/' . $filename);
748
+                        $fs->copy($this->appConfig['image_save_realdir'].'/'.$Image->getFileName(), $this->appConfig['image_save_realdir'].'/'.$filename);
749 749
                     } catch (\Exception $e) {
750 750
                         // エラーが発生しても無視する
751 751
                     }
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
         $em->getConfiguration()->setSQLLogger(null);
826 826
 
827 827
         $response = new StreamedResponse();
828
-        $response->setCallback(function () use ($app, $request) {
828
+        $response->setCallback(function() use ($app, $request) {
829 829
 
830 830
             // CSV種別を元に初期化.
831 831
             $this->csvExportService->initCsvType(CsvType::CSV_TYPE_PRODUCT);
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
             // データ行の出力.
866 866
             $this->csvExportService->setExportQueryBuilder($qb);
867 867
 
868
-            $this->csvExportService->exportData(function ($entity, CsvExportService $csvService) use ($app, $request) {
868
+            $this->csvExportService->exportData(function($entity, CsvExportService $csvService) use ($app, $request) {
869 869
                 $Csvs = $csvService->getCsvs();
870 870
 
871 871
                 /** @var $Product \Eccube\Entity\Product */
@@ -908,9 +908,9 @@  discard block
 block discarded – undo
908 908
         });
909 909
 
910 910
         $now = new \DateTime();
911
-        $filename = 'product_' . $now->format('YmdHis') . '.csv';
911
+        $filename = 'product_'.$now->format('YmdHis').'.csv';
912 912
         $response->headers->set('Content-Type', 'application/octet-stream');
913
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
913
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
914 914
         $response->send();
915 915
 
916 916
         log_info('商品CSV出力ファイル名', array($filename));
Please login to merge, or discard this patch.