Failed Conditions
Pull Request — experimental/3.1 (#2374)
by Kentaro
29:44
created
src/Eccube/Repository/QueryKey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 {
29 29
     const PRODUCT_SEARCH = 'Product.getQueryBuilderBySearchData';
30 30
     const PRODUCT_SEARCH_ADMIN = 'Product.getQueryBuilderBySearchDataForAdmin';
31
-    const PRODUCT_GET_FAVORITE  = 'Product.getFavoriteProductQueryBuilderByCustomer';
31
+    const PRODUCT_GET_FAVORITE = 'Product.getFavoriteProductQueryBuilderByCustomer';
32 32
 
33 33
     const CUSTOMER_SEARCH = 'Customer.getQueryBuilderBySearchData';
34 34
 
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Admin/OrderType.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -53,6 +53,9 @@
 block discarded – undo
53 53
 
54 54
     protected $app;
55 55
 
56
+    /**
57
+     * @param \Pimple\Container $app
58
+     */
56 59
     public function __construct($app)
57 60
     {
58 61
         $this->app = $app;
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,6 @@
 block discarded – undo
35 35
 use Symfony\Component\Form\AbstractType;
36 36
 use Symfony\Component\Form\Extension\Core\Type\CollectionType;
37 37
 use Symfony\Component\Form\Extension\Core\Type\EmailType;
38
-use Symfony\Component\Form\Extension\Core\Type\FormType;
39 38
 use Symfony\Component\Form\Extension\Core\Type\HiddenType;
40 39
 use Symfony\Component\Form\Extension\Core\Type\MoneyType;
41 40
 use Symfony\Component\Form\Extension\Core\Type\TextareaType;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         /**
258 258
          * 複数配送オプション有効時の画面制御を行う.
259 259
          */
260
-        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($BaseInfo) {
260
+        $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($BaseInfo) {
261 261
 
262 262
             if ($BaseInfo->getOptionMultipleShipping() != Constant::ENABLED) {
263 263
                 return;
@@ -267,17 +267,16 @@  discard block
 block discarded – undo
267 267
             $orderDetails = &$data['OrderDetails'];
268 268
 
269 269
             // 数量0フィルター
270
-            $quantityFilter = function ($v) {
270
+            $quantityFilter = function($v) {
271 271
                 return !(isset($v['quantity']) && preg_match('/^0+$/', trim($v['quantity'])));
272 272
             };
273 273
 
274 274
             // $shippings = &$data['Shippings'];
275 275
 
276 276
             // 数量を抽出
277
-            $getQuantity = function ($v) {
277
+            $getQuantity = function($v) {
278 278
                 return (isset($v['quantity']) && preg_match('/^\d+$/', trim($v['quantity']))) ?
279
-                    trim($v['quantity']) :
280
-                    0;
279
+                    trim($v['quantity']) : 0;
281 280
             };
282 281
 
283 282
             // foreach ($shippings as &$shipping) {
@@ -294,7 +293,7 @@  discard block
 block discarded – undo
294 293
                     $orderDetail['quantity'] = 0;
295 294
 
296 295
                     // 受注詳細と同じ商品規格のみ抽出
297
-                    $productClassFilter = function ($v) use ($orderDetail) {
296
+                    $productClassFilter = function($v) use ($orderDetail) {
298 297
                         return $orderDetail['ProductClass'] === $v['ProductClass'];
299 298
                     };
300 299
 
@@ -303,10 +302,9 @@  discard block
 block discarded – undo
303 302
                         if (!empty($shipping['ShipmentItems'])) {
304 303
 
305 304
                             // 同じ商品規格の受注詳細の価格を適用
306
-                            $applyPrice = function (&$v) use ($orderDetail) {
305
+                            $applyPrice = function(&$v) use ($orderDetail) {
307 306
                                 $v['price'] = ($v['ProductClass'] === $orderDetail['ProductClass']) ?
308
-                                    $orderDetail['price'] :
309
-                                    $v['price'];
307
+                                    $orderDetail['price'] : $v['price'];
310 308
                             };
311 309
                             array_walk($shipping['ShipmentItems'], $applyPrice);
312 310
 
@@ -335,7 +333,7 @@  discard block
 block discarded – undo
335 333
         //     }
336 334
         // });
337 335
         // 選択された支払い方法の名称をエンティティにコピーする
338
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
336
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
339 337
             $Order = $event->getData();
340 338
             $Payment = $Order->getPayment();
341 339
             if (!is_null($Payment)) {
@@ -343,7 +341,7 @@  discard block
 block discarded – undo
343 341
             }
344 342
         });
345 343
         // TODO 手数料, 値引きの集計は CalculateService で
346
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
344
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
347 345
             $Order = $event->getData();
348 346
             $Order->setDiscount($Order->calculateDiscountTotal());
349 347
             // $Order->setCharge($Order->calculateChargeTotal());
@@ -351,7 +349,7 @@  discard block
 block discarded – undo
351 349
             $event->setData($Order);
352 350
         });
353 351
         // 会員受注の場合、会員の性別/職業/誕生日をエンティティにコピーする
354
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
352
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
355 353
             $Order = $event->getData();
356 354
             $Customer = $Order->getCustomer();
357 355
             if (!is_null($Customer)) {
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Shopping/ShippingType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         // 配送業者のプルダウンを生成
60 60
         $builder->addEventListener(
61 61
             FormEvents::PRE_SET_DATA,
62
-            function (FormEvent $event) {
62
+            function(FormEvent $event) {
63 63
                 /* @var Shipping $Shipping */
64 64
                 $Shipping = $event->getData();
65 65
                 if (is_null($Shipping) || !$Shipping->getId()) {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         // お届け日のプルダウンを生成
102 102
         $builder->addEventListener(
103 103
             FormEvents::PRE_SET_DATA,
104
-            function (FormEvent $event) {
104
+            function(FormEvent $event) {
105 105
                 $Shipping = $event->getData();
106 106
                 if (is_null($Shipping) || !$Shipping->getId()) {
107 107
                     return;
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
                 // 配送日数が設定されている
141 141
                 if ($deliveryDateFlag) {
142
-                    $period = new \DatePeriod (
142
+                    $period = new \DatePeriod(
143 143
                         new \DateTime($minDate.' day'),
144 144
                         new \DateInterval('P1D'),
145 145
                         new \DateTime($minDate + $this->config['deliv_date_end_max'].' day')
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         // お届け時間のプルダウンを生成
168 168
         $builder->addEventListener(
169 169
             FormEvents::PRE_SET_DATA,
170
-            function (FormEvent $event) {
170
+            function(FormEvent $event) {
171 171
                 $Shipping = $event->getData();
172 172
                 if (is_null($Shipping) || !$Shipping->getId()) {
173 173
                     return;
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Shopping/OrderType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         // 支払い方法のプルダウンを生成
86 86
         $builder->addEventListener(
87 87
             FormEvents::PRE_SET_DATA,
88
-            function (FormEvent $event) {
88
+            function(FormEvent $event) {
89 89
                 /** @var Order $Order */
90 90
                 $Order = $event->getData();
91 91
                 if (is_null($Order) || !$Order->getId()) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         // TODO Calculatorで行うのが適切.
134 134
         $builder->addEventListener(
135 135
             FormEvents::POST_SUBMIT,
136
-            function (FormEvent $event) {
136
+            function(FormEvent $event) {
137 137
                 /** @var Order $Order */
138 138
                 $Order = $event->getData();
139 139
                 $Payment = $Order->getPayment();
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Admin/ShippingType.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                 'prototype' => true,
176 176
             ))
177 177
 
178
-            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($BaseInfo) {
178
+            ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($BaseInfo) {
179 179
                 if ($BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) {
180 180
                     $form = $event->getForm();
181 181
                     $form->add('ShipmentItems', CollectionType::class, array(
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                     ));
187 187
                 }
188 188
             })
189
-            ->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event) {
189
+            ->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event) {
190 190
                 /** @var \Eccube\Entity\Shipping $data */
191 191
                 $data = $event->getData();
192 192
                 /** @var \Symfony\Component\Form\Form $form */
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                     'choice_label' => 'delivery_time',
206 206
                     'placeholder' => '指定なし',
207 207
                     'required' => false,
208
-                    'query_builder' => function (EntityRepository $er) use($Delivery) {
208
+                    'query_builder' => function(EntityRepository $er) use($Delivery) {
209 209
                         return $er->createQueryBuilder('dt')
210 210
                             ->where('dt.Delivery = :Delivery')
211 211
                             ->setParameter('Delivery', $Delivery);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 ));
214 214
 
215 215
             })
216
-            ->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) {
216
+            ->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) {
217 217
                 $data = $event->getData();
218 218
                 $form = $event->getForm();
219 219
                 if (!$data) {
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
                     'choice_label' => 'delivery_time',
234 234
                     'placeholder' => '指定なし',
235 235
                     'required' => false,
236
-                    'query_builder' => function (EntityRepository $er) use($Delivery) {
236
+                    'query_builder' => function(EntityRepository $er) use($Delivery) {
237 237
                         return $er->createQueryBuilder('dt')
238 238
                             ->where('dt.Delivery = :Delivery')
239 239
                             ->setParameter('Delivery', $Delivery);
240 240
                     },
241 241
                 ));
242 242
             })
243
-            ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($BaseInfo) {
243
+            ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($BaseInfo) {
244 244
                 if ($BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) {
245 245
                     $form = $event->getForm();
246 246
                     $shipmentItems = $form['ShipmentItems']->getData();
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                     }
252 252
                 }
253 253
             })
254
-            ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($BaseInfo) {
254
+            ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($BaseInfo) {
255 255
                 $Shipping = $event->getData();
256 256
                 $Delivery = $Shipping->getDelivery();
257 257
                 $Shipping->setShippingDeliveryName($Delivery ? $Delivery : null);
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Shipping/EditController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -446,7 +446,7 @@
 block discarded – undo
446 446
                 $session->set('eccube.admin.order.product.search', $searchData);
447 447
                 $session->set('eccube.admin.order.product.search.page_no', $page_no);
448 448
             } else {
449
-                $searchData = (array)$session->get('eccube.admin.order.product.search');
449
+                $searchData = (array) $session->get('eccube.admin.order.product.search');
450 450
                 if (is_null($page_no)) {
451 451
                     $page_no = intval($session->get('eccube.admin.order.product.search.page_no'));
452 452
                 } else {
Please login to merge, or discard this patch.
Unused Use Statements   -8 removed lines patch added patch discarded remove patch
@@ -4,25 +4,17 @@
 block discarded – undo
4 4
 
5 5
 use Doctrine\Common\Collections\ArrayCollection;
6 6
 use Eccube\Application;
7
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
8 7
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9 8
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
10 9
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
11 10
 use Symfony\Component\HttpFoundation\Request;
12
-
13
-use Eccube\Common\Constant;
14
-use Eccube\Controller\AbstractController;
15 11
 use Eccube\Entity\Shipping;
16
-use Eccube\Entity\Master\CsvType;
17 12
 use Eccube\Event\EccubeEvents;
18 13
 use Eccube\Event\EventArgs;
19
-use Eccube\Form\Type\AddCartType;
20
-use Eccube\Form\Type\Admin\SearchOrderType;
21 14
 use Eccube\Form\Type\Admin\ShippingType;
22 15
 use Eccube\Form\Type\Admin\SearchCustomerType;
23 16
 use Eccube\Form\Type\Admin\SearchProductType;
24 17
 use Eccube\Form\Type\Admin\ShipmentItemType;
25
-use Symfony\Component\HttpFoundation\StreamedResponse;
26 18
 
27 19
 /**
28 20
  * @Route("/{_admin}/shipping")
Please login to merge, or discard this patch.
src/Eccube/Repository/ShippingRepository.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     /**
38 38
      *
39 39
      * @param  array        $searchData
40
-     * @return QueryBuilder
40
+     * @return \Doctrine\ORM\QueryBuilder
41 41
      */
42 42
     public function getQueryBuilderBySearchDataForAdmin($searchData)
43 43
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null;
57 57
             $qb
58 58
                 ->andWhere('s.id = :multi OR s.name01 LIKE :likemulti OR s.name02 LIKE :likemulti OR ' .
59
-                           's.kana01 LIKE :likemulti OR s.kana02 LIKE :likemulti OR s.company_name LIKE :likemulti')
59
+                            's.kana01 LIKE :likemulti OR s.kana02 LIKE :likemulti OR s.company_name LIKE :likemulti')
60 60
                 ->setParameter('multi', $multi)
61 61
                 ->setParameter('likemulti', '%' . $searchData['multi'] . '%');
62 62
         }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
                 ->setParameter('shipping_id_start', $searchData['shipping_id_start']);
53 53
         }
54 54
         // multi
55
-        if (isset( $searchData['multi']) && Str::isNotBlank($searchData['multi'])) {
55
+        if (isset($searchData['multi']) && Str::isNotBlank($searchData['multi'])) {
56 56
             $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null;
57 57
             $qb
58
-                ->andWhere('s.id = :multi OR s.name01 LIKE :likemulti OR s.name02 LIKE :likemulti OR ' .
58
+                ->andWhere('s.id = :multi OR s.name01 LIKE :likemulti OR s.name02 LIKE :likemulti OR '.
59 59
                            's.kana01 LIKE :likemulti OR s.kana02 LIKE :likemulti OR s.company_name LIKE :likemulti')
60 60
                 ->setParameter('multi', $multi)
61
-                ->setParameter('likemulti', '%' . $searchData['multi'] . '%');
61
+                ->setParameter('likemulti', '%'.$searchData['multi'].'%');
62 62
         }
63 63
 
64 64
         // shipping_id_end
@@ -91,42 +91,42 @@  discard block
 block discarded – undo
91 91
         if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) {
92 92
             $qb
93 93
                 ->andWhere('CONCAT(s.name01, s.name02) LIKE :name')
94
-                ->setParameter('name', '%' . $searchData['name'] . '%');
94
+                ->setParameter('name', '%'.$searchData['name'].'%');
95 95
         }
96 96
 
97 97
         // kana
98 98
         if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) {
99 99
             $qb
100 100
                 ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana')
101
-                ->setParameter('kana', '%' . $searchData['kana'] . '%');
101
+                ->setParameter('kana', '%'.$searchData['kana'].'%');
102 102
         }
103 103
 
104 104
         // order_name
105 105
         if (isset($searchData['order_name']) && Str::isNotBlank($searchData['order_name'])) {
106 106
             $qb
107 107
                 ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name')
108
-                ->setParameter('order_name', '%' . $searchData['order_name'] . '%');
108
+                ->setParameter('order_name', '%'.$searchData['order_name'].'%');
109 109
         }
110 110
 
111 111
         // order_kana
112 112
         if (isset($searchData['order_kana']) && Str::isNotBlank($searchData['order_kana'])) {
113 113
             $qb
114 114
                 ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana')
115
-                ->setParameter('kana', '%' . $searchData['order_kana'] . '%');
115
+                ->setParameter('kana', '%'.$searchData['order_kana'].'%');
116 116
         }
117 117
 
118 118
         // order_email
119 119
         if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) {
120 120
             $qb
121 121
                 ->andWhere('o.email like :email')
122
-                ->setParameter('email', '%' . $searchData['email'] . '%');
122
+                ->setParameter('email', '%'.$searchData['email'].'%');
123 123
         }
124 124
 
125 125
         // tel
126 126
         if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) {
127 127
             $qb
128 128
                 ->andWhere('CONCAT(s.tel01, s.tel02, s.tel03) LIKE :tel')
129
-                ->setParameter('tel', '%' . $searchData['tel'] . '%');
129
+                ->setParameter('tel', '%'.$searchData['tel'].'%');
130 130
         }
131 131
 
132 132
         // payment
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) {
223 223
             $qb
224 224
                 ->andWhere('si.product_name LIKE :buy_product_name')
225
-                ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%');
225
+                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
226 226
         }
227 227
 
228 228
         // Order By
Please login to merge, or discard this patch.
app/Plugin/EntityEvent/ServiceProvider/EntityEventServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 {
13 13
     public function register(Container $app)
14 14
     {
15
-        $app['plugin.entity_event.base_info_listener'] = function (Container $container) {
15
+        $app['plugin.entity_event.base_info_listener'] = function(Container $container) {
16 16
             return new BaseInfoListener();
17 17
         };
18 18
     }
Please login to merge, or discard this patch.
app/Plugin/QueryCustomize/ServiceProvider/QueryCustomizeServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 {
13 13
     public function register(Container $app)
14 14
     {
15
-        $app['plugin.query_customize.customer_search'] = function (Container $container) {
15
+        $app['plugin.query_customize.customer_search'] = function(Container $container) {
16 16
             return new AdminCustomerCustomizer();
17 17
         };
18 18
     }
Please login to merge, or discard this patch.