Completed
Pull Request — experimental/3.1 (#2343)
by Kentaro
51:52
created
src/Eccube/Form/Type/Admin/ShipmentItemType.php 1 patch
Spacing   +6 added lines, -10 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $app = $this->app;
146 146
         // XXX price を priceIncTax にセットし直す
147 147
         // どこか一箇所にまとめたい
148
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($app) {
148
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($app) {
149 149
                 /** @var \Eccube\Entity\ShipmentItem $ShipmentItem */
150 150
                 $ShipmentItem = $event->getData();
151 151
                 $TaxDisplayType = $ShipmentItem->getTaxDisplayType();
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
                 $event->setData($ShipmentItem);
165 165
         });
166
-        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) {
166
+        $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) {
167 167
             // モーダルからのPOST時に、金額等をセットする.
168 168
             if ('modal' === $app['request_stack']->getCurrentRequest()->get('modal')) {
169 169
                 $data = $event->getData();
@@ -233,17 +233,13 @@  discard block
 block discarded – undo
233 233
                                 $data['product_name'] = $Product->getName();
234 234
                                 $data['product_code'] = $ProductClass->getCode();
235 235
                                 $data['class_name1'] = $ProductClass->hasClassCategory1() ?
236
-                                    $ProductClass->getClassCategory1()->getClassName() :
237
-                                    null;
236
+                                    $ProductClass->getClassCategory1()->getClassName() : null;
238 237
                                 $data['class_name2'] = $ProductClass->hasClassCategory2() ?
239
-                                    $ProductClass->getClassCategory2()->getClassName() :
240
-                                    null;
238
+                                    $ProductClass->getClassCategory2()->getClassName() : null;
241 239
                                 $data['class_category_name1'] = $ProductClass->hasClassCategory1() ?
242
-                                    $ProductClass->getClassCategory1()->getName() :
243
-                                    null;
240
+                                    $ProductClass->getClassCategory1()->getName() : null;
244 241
                                 $data['class_category_name2'] = $ProductClass->hasClassCategory2() ?
245
-                                    $ProductClass->getClassCategory2()->getName() :
246
-                                    null;
242
+                                    $ProductClass->getClassCategory2()->getName() : null;
247 243
                                 $data['price'] = $ProductClass->getPrice02();
248 244
                                 $data['quantity'] = empty($data['quantity']) ? 1 : $data['quantity'];
249 245
                                 $data['tax_type'] = TaxType::TAXATION;
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Admin/OrderType.php 1 patch
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         /**
257 257
          * 複数配送オプション有効時の画面制御を行う.
258 258
          */
259
-        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($BaseInfo) {
259
+        $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($BaseInfo) {
260 260
 
261 261
             if ($BaseInfo->getOptionMultipleShipping() != Constant::ENABLED) {
262 262
                 return;
@@ -266,17 +266,16 @@  discard block
 block discarded – undo
266 266
             $orderDetails = &$data['OrderDetails'];
267 267
 
268 268
             // 数量0フィルター
269
-            $quantityFilter = function ($v) {
269
+            $quantityFilter = function($v) {
270 270
                 return !(isset($v['quantity']) && preg_match('/^0+$/', trim($v['quantity'])));
271 271
             };
272 272
 
273 273
             // $shippings = &$data['Shippings'];
274 274
 
275 275
             // 数量を抽出
276
-            $getQuantity = function ($v) {
276
+            $getQuantity = function($v) {
277 277
                 return (isset($v['quantity']) && preg_match('/^\d+$/', trim($v['quantity']))) ?
278
-                    trim($v['quantity']) :
279
-                    0;
278
+                    trim($v['quantity']) : 0;
280 279
             };
281 280
 
282 281
             // foreach ($shippings as &$shipping) {
@@ -293,7 +292,7 @@  discard block
 block discarded – undo
293 292
                     $orderDetail['quantity'] = 0;
294 293
 
295 294
                     // 受注詳細と同じ商品規格のみ抽出
296
-                    $productClassFilter = function ($v) use ($orderDetail) {
295
+                    $productClassFilter = function($v) use ($orderDetail) {
297 296
                         return $orderDetail['ProductClass'] === $v['ProductClass'];
298 297
                     };
299 298
 
@@ -302,10 +301,9 @@  discard block
 block discarded – undo
302 301
                         if (!empty($shipping['ShipmentItems'])) {
303 302
 
304 303
                             // 同じ商品規格の受注詳細の価格を適用
305
-                            $applyPrice = function (&$v) use ($orderDetail) {
304
+                            $applyPrice = function(&$v) use ($orderDetail) {
306 305
                                 $v['price'] = ($v['ProductClass'] === $orderDetail['ProductClass']) ?
307
-                                    $orderDetail['price'] :
308
-                                    $v['price'];
306
+                                    $orderDetail['price'] : $v['price'];
309 307
                             };
310 308
                             array_walk($shipping['ShipmentItems'], $applyPrice);
311 309
 
@@ -334,7 +332,7 @@  discard block
 block discarded – undo
334 332
         //     }
335 333
         // });
336 334
         // 選択された支払い方法の名称をエンティティにコピーする
337
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
335
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
338 336
             $Order = $event->getData();
339 337
             $Payment = $Order->getPayment();
340 338
             if (!is_null($Payment)) {
@@ -342,7 +340,7 @@  discard block
 block discarded – undo
342 340
             }
343 341
         });
344 342
         // TODO 手数料, 値引きの集計は CalculateService で
345
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
343
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
346 344
             $Order = $event->getData();
347 345
             $Order->setDiscount($Order->calculateDiscountTotal());
348 346
             $Order->setCharge($Order->calculateChargeTotal());
@@ -350,7 +348,7 @@  discard block
 block discarded – undo
350 348
             $event->setData($Order);
351 349
         });
352 350
         // 会員受注の場合、会員の性別/職業/誕生日をエンティティにコピーする
353
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
351
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
354 352
             $Order = $event->getData();
355 353
             $Customer = $Order->getCustomer();
356 354
             if (!is_null($Customer)) {
Please login to merge, or discard this patch.