Failed Conditions
Push — master ( e5a837...4e5714 )
by Kentaro
19s
created
src/Eccube/Form/Type/Admin/OrderType.php 1 patch
Spacing   +8 added lines, -10 removed lines patch added patch discarded remove patch
@@ -234,13 +234,13 @@  discard block
 block discarded – undo
234 234
                     '\Eccube\Entity\Customer'
235 235
                 )));
236 236
 
237
-        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($BaseInfo) {
237
+        $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($BaseInfo) {
238 238
 
239 239
             $data = $event->getData();
240 240
             $orderDetails = &$data['OrderDetails'];
241 241
 
242 242
             // 数量0フィルター
243
-            $quantityFilter = function ($v) {
243
+            $quantityFilter = function($v) {
244 244
                 return !(isset($v['quantity']) && preg_match('/^0+$/', trim($v['quantity'])));
245 245
             };
246 246
 
@@ -249,10 +249,9 @@  discard block
 block discarded – undo
249 249
                 $shippings = &$data['Shippings'];
250 250
 
251 251
                 // 数量を抽出
252
-                $getQuantity = function ($v) {
252
+                $getQuantity = function($v) {
253 253
                     return (isset($v['quantity']) && preg_match('/^\d+$/', trim($v['quantity']))) ?
254
-                        trim($v['quantity']) :
255
-                        0;
254
+                        trim($v['quantity']) : 0;
256 255
                 };
257 256
 
258 257
                 foreach ($shippings as &$shipping) {
@@ -268,7 +267,7 @@  discard block
 block discarded – undo
268 267
                         $orderDetail['quantity'] = 0;
269 268
 
270 269
                         // 受注詳細と同じ商品規格のみ抽出
271
-                        $productClassFilter = function ($v) use ($orderDetail) {
270
+                        $productClassFilter = function($v) use ($orderDetail) {
272 271
                             return $orderDetail['ProductClass'] === $v['ProductClass'];
273 272
                         };
274 273
 
@@ -277,10 +276,9 @@  discard block
 block discarded – undo
277 276
                             if (!empty($shipping['ShipmentItems'])) {
278 277
 
279 278
                                 // 同じ商品規格の受注詳細の価格を適用
280
-                                $applyPrice = function (&$v) use ($orderDetail) {
279
+                                $applyPrice = function(&$v) use ($orderDetail) {
281 280
                                     $v['price'] = ($v['ProductClass'] === $orderDetail['ProductClass']) ?
282
-                                        $orderDetail['price'] :
283
-                                        $v['price'];
281
+                                        $orderDetail['price'] : $v['price'];
284 282
                                 };
285 283
                                 array_walk($shipping['ShipmentItems'], $applyPrice);
286 284
 
@@ -300,7 +298,7 @@  discard block
 block discarded – undo
300 298
 
301 299
             $event->setData($data);
302 300
         });
303
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
301
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
304 302
             $form = $event->getForm();
305 303
             $orderDetails = $form['OrderDetails']->getData();
306 304
             if (empty($orderDetails) || count($orderDetails) < 1) {
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Admin/OrderDetailType.php 1 patch
Spacing   +5 added lines, -9 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 )));
111 111
 
112 112
         $app = $this->app;
113
-        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) {
113
+        $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) {
114 114
             // モーダルからのPOST時に、金額等をセットする.
115 115
             if ('modal' === $app['request']->get('modal')) {
116 116
                 $data = $event->getData();
@@ -127,17 +127,13 @@  discard block
 block discarded – undo
127 127
                     $data['product_name'] = $Product->getName();
128 128
                     $data['product_code'] = $ProductClass->getCode();
129 129
                     $data['class_name1'] = $ProductClass->hasClassCategory1() ?
130
-                        $ProductClass->getClassCategory1()->getClassName() :
131
-                        null;
130
+                        $ProductClass->getClassCategory1()->getClassName() : null;
132 131
                     $data['class_name2'] = $ProductClass->hasClassCategory2() ?
133
-                        $ProductClass->getClassCategory2()->getClassName() :
134
-                        null;
132
+                        $ProductClass->getClassCategory2()->getClassName() : null;
135 133
                     $data['class_category_name1'] = $ProductClass->hasClassCategory1() ?
136
-                        $ProductClass->getClassCategory1()->getName() :
137
-                        null;
134
+                        $ProductClass->getClassCategory1()->getName() : null;
138 135
                     $data['class_category_name2'] = $ProductClass->hasClassCategory2() ?
139
-                        $ProductClass->getClassCategory2()->getName() :
140
-                        null;
136
+                        $ProductClass->getClassCategory2()->getName() : null;
141 137
                     $data['tax_rule'] = $TaxRule->getCalcRule()->getId();
142 138
                     $data['price'] = $ProductClass->getPrice02();
143 139
                     $data['quantity'] = empty($data['quantity']) ? 1 : $data['quantity'];
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Admin/ShipmentItemType.php 1 patch
Spacing   +5 added lines, -9 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 )));
111 111
 
112 112
         $app = $this->app;
113
-        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) {
113
+        $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) {
114 114
             // モーダルからのPOST時に、金額等をセットする.
115 115
             if ('modal' === $app['request']->get('modal')) {
116 116
                 $data = $event->getData();
@@ -127,17 +127,13 @@  discard block
 block discarded – undo
127 127
                     $data['product_name'] = $Product->getName();
128 128
                     $data['product_code'] = $ProductClass->getCode();
129 129
                     $data['class_name1'] = $ProductClass->hasClassCategory1() ?
130
-                        $ProductClass->getClassCategory1()->getClassName() :
131
-                        null;
130
+                        $ProductClass->getClassCategory1()->getClassName() : null;
132 131
                     $data['class_name2'] = $ProductClass->hasClassCategory2() ?
133
-                        $ProductClass->getClassCategory2()->getClassName() :
134
-                        null;
132
+                        $ProductClass->getClassCategory2()->getClassName() : null;
135 133
                     $data['class_category_name1'] = $ProductClass->hasClassCategory1() ?
136
-                        $ProductClass->getClassCategory1()->getName() :
137
-                        null;
134
+                        $ProductClass->getClassCategory1()->getName() : null;
138 135
                     $data['class_category_name2'] = $ProductClass->hasClassCategory2() ?
139
-                        $ProductClass->getClassCategory2()->getName() :
140
-                        null;
136
+                        $ProductClass->getClassCategory2()->getName() : null;
141 137
                     $data['tax_rule'] = $TaxRule->getCalcRule()->getId();
142 138
                     $data['price'] = $ProductClass->getPrice02();
143 139
                     $data['quantity'] = empty($data['quantity']) ? 1 : $data['quantity'];
Please login to merge, or discard this patch.