@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * 複数配送オプション有効時の画面制御を行う. |
254 | 254 | */ |
255 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
255 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
256 | 256 | |
257 | 257 | if ($this->BaseInfo->getOptionMultipleShipping() != Constant::ENABLED) { |
258 | 258 | return; |
@@ -262,17 +262,16 @@ discard block |
||
262 | 262 | $orderDetails = &$data['OrderDetails']; |
263 | 263 | |
264 | 264 | // 数量0フィルター |
265 | - $quantityFilter = function ($v) { |
|
265 | + $quantityFilter = function($v) { |
|
266 | 266 | return !(isset($v['quantity']) && preg_match('/^0+$/', trim($v['quantity']))); |
267 | 267 | }; |
268 | 268 | |
269 | 269 | // $shippings = &$data['Shippings']; |
270 | 270 | |
271 | 271 | // 数量を抽出 |
272 | - $getQuantity = function ($v) { |
|
272 | + $getQuantity = function($v) { |
|
273 | 273 | return (isset($v['quantity']) && preg_match('/^\d+$/', trim($v['quantity']))) ? |
274 | - trim($v['quantity']) : |
|
275 | - 0; |
|
274 | + trim($v['quantity']) : 0; |
|
276 | 275 | }; |
277 | 276 | |
278 | 277 | // foreach ($shippings as &$shipping) { |
@@ -289,7 +288,7 @@ discard block |
||
289 | 288 | $orderDetail['quantity'] = 0; |
290 | 289 | |
291 | 290 | // 受注詳細と同じ商品規格のみ抽出 |
292 | - $productClassFilter = function ($v) use ($orderDetail) { |
|
291 | + $productClassFilter = function($v) use ($orderDetail) { |
|
293 | 292 | return $orderDetail['ProductClass'] === $v['ProductClass']; |
294 | 293 | }; |
295 | 294 | |
@@ -298,10 +297,9 @@ discard block |
||
298 | 297 | if (!empty($shipping['ShipmentItems'])) { |
299 | 298 | |
300 | 299 | // 同じ商品規格の受注詳細の価格を適用 |
301 | - $applyPrice = function (&$v) use ($orderDetail) { |
|
300 | + $applyPrice = function(&$v) use ($orderDetail) { |
|
302 | 301 | $v['price'] = ($v['ProductClass'] === $orderDetail['ProductClass']) ? |
303 | - $orderDetail['price'] : |
|
304 | - $v['price']; |
|
302 | + $orderDetail['price'] : $v['price']; |
|
305 | 303 | }; |
306 | 304 | array_walk($shipping['ShipmentItems'], $applyPrice); |
307 | 305 | |
@@ -330,7 +328,7 @@ discard block |
||
330 | 328 | // } |
331 | 329 | // }); |
332 | 330 | // 選択された支払い方法の名称をエンティティにコピーする |
333 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
331 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
334 | 332 | $Order = $event->getData(); |
335 | 333 | $Payment = $Order->getPayment(); |
336 | 334 | if (!is_null($Payment)) { |
@@ -338,7 +336,7 @@ discard block |
||
338 | 336 | } |
339 | 337 | }); |
340 | 338 | // 会員受注の場合、会員の性別/職業/誕生日をエンティティにコピーする |
341 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
339 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
342 | 340 | $Order = $event->getData(); |
343 | 341 | $Customer = $Order->getCustomer(); |
344 | 342 | if (!is_null($Customer)) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | 'prototype' => true, |
200 | 200 | )) |
201 | 201 | |
202 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
202 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
203 | 203 | if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) { |
204 | 204 | $form = $event->getForm(); |
205 | 205 | $form->add('ShipmentItems', CollectionType::class, array( |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | )); |
211 | 211 | } |
212 | 212 | }) |
213 | - ->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event) { |
|
213 | + ->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event) { |
|
214 | 214 | /** @var \Eccube\Entity\Shipping $data */ |
215 | 215 | $data = $event->getData(); |
216 | 216 | /** @var \Symfony\Component\Form\Form $form */ |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | 'choice_label' => 'delivery_time', |
230 | 230 | 'placeholder' => '指定なし', |
231 | 231 | 'required' => false, |
232 | - 'query_builder' => function (EntityRepository $er) use($Delivery) { |
|
232 | + 'query_builder' => function(EntityRepository $er) use($Delivery) { |
|
233 | 233 | return $er->createQueryBuilder('dt') |
234 | 234 | ->where('dt.Delivery = :Delivery') |
235 | 235 | ->setParameter('Delivery', $Delivery); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | )); |
238 | 238 | |
239 | 239 | }) |
240 | - ->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
240 | + ->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
241 | 241 | $data = $event->getData(); |
242 | 242 | $form = $event->getForm(); |
243 | 243 | if (!$data) { |
@@ -257,14 +257,14 @@ discard block |
||
257 | 257 | 'choice_label' => 'delivery_time', |
258 | 258 | 'placeholder' => '指定なし', |
259 | 259 | 'required' => false, |
260 | - 'query_builder' => function (EntityRepository $er) use($Delivery) { |
|
260 | + 'query_builder' => function(EntityRepository $er) use($Delivery) { |
|
261 | 261 | return $er->createQueryBuilder('dt') |
262 | 262 | ->where('dt.Delivery = :Delivery') |
263 | 263 | ->setParameter('Delivery', $Delivery); |
264 | 264 | }, |
265 | 265 | )); |
266 | 266 | }) |
267 | - ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
267 | + ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
268 | 268 | if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) { |
269 | 269 | $form = $event->getForm(); |
270 | 270 | $shipmentItems = $form['ShipmentItems']->getData(); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } |
276 | 276 | } |
277 | 277 | }) |
278 | - ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
278 | + ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
279 | 279 | $Shipping = $event->getData(); |
280 | 280 | $Delivery = $Shipping->getDelivery(); |
281 | 281 | $Shipping->setShippingDeliveryName($Delivery ? $Delivery : null); |
@@ -28,7 +28,6 @@ |
||
28 | 28 | use Eccube\Annotation\Inject; |
29 | 29 | use Eccube\Application; |
30 | 30 | use Eccube\Entity\CartItem; |
31 | -use Eccube\Entity\ProductClass; |
|
32 | 31 | use Eccube\Event\EccubeEvents; |
33 | 32 | use Eccube\Event\EventArgs; |
34 | 33 | use Eccube\Repository\ProductClassRepository; |
@@ -27,7 +27,6 @@ |
||
27 | 27 | use Doctrine\ORM\EntityManager; |
28 | 28 | use Eccube\Annotation\FormType; |
29 | 29 | use Eccube\Annotation\Inject; |
30 | -use Eccube\Application; |
|
31 | 30 | use Eccube\Entity\CartItem; |
32 | 31 | use Eccube\Form\DataTransformer\EntityToIdTransformer; |
33 | 32 | use Symfony\Component\Form\AbstractType; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($Product) { |
|
127 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($Product) { |
|
128 | 128 | $data = $event->getData(); |
129 | 129 | $form = $event->getForm(); |
130 | 130 | if (isset($data['classcategory_id1']) && !is_null($Product->getClassName2())) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | }); |
139 | 139 | |
140 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
140 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
141 | 141 | /** @var CartItem $CartItem */ |
142 | 142 | $CartItem = $event->getData(); |
143 | 143 | $ProductClass = $CartItem->getProductClass(); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | { |
81 | 81 | $collection = $this; |
82 | 82 | |
83 | - $newFunc = function ($element) use ($collection, $func) { |
|
83 | + $newFunc = function($element) use ($collection, $func) { |
|
84 | 84 | |
85 | 85 | $new = $func($element); |
86 | 86 |
@@ -39,12 +39,12 @@ |
||
39 | 39 | $OrderItemType1 = $Item1->getOrderItemType(); |
40 | 40 | $OrderItemType2 = $Item2->getOrderItemType(); |
41 | 41 | |
42 | - $order_item_type_id1 = $OrderItemType1 ? (string)$OrderItemType1->getId() : null; |
|
43 | - $order_item_type_id2 = $OrderItemType2 ? (string)$OrderItemType2->getId() : null; |
|
42 | + $order_item_type_id1 = $OrderItemType1 ? (string) $OrderItemType1->getId() : null; |
|
43 | + $order_item_type_id2 = $OrderItemType2 ? (string) $OrderItemType2->getId() : null; |
|
44 | 44 | |
45 | 45 | // FIXME 暫定的に、商品以外は全て別商品とする |
46 | 46 | return |
47 | - $order_item_type_id1 === (string)OrderItemType::PRODUCT && |
|
48 | - $order_item_type_id2 === (string)OrderItemType::PRODUCT; |
|
47 | + $order_item_type_id1 === (string) OrderItemType::PRODUCT && |
|
48 | + $order_item_type_id2 === (string) OrderItemType::PRODUCT; |
|
49 | 49 | } |
50 | 50 | } |
@@ -37,7 +37,6 @@ |
||
37 | 37 | ( |
38 | 38 | intval($Item1->getTaxRule()) === intval($Item2->getTaxRule()) && |
39 | 39 | intval($Item1->getTaxRate()) === intval($Item2->getTaxRate()) |
40 | - ) : |
|
41 | - true; |
|
40 | + ) : true; |
|
42 | 41 | } |
43 | 42 | } |
@@ -34,8 +34,8 @@ |
||
34 | 34 | { |
35 | 35 | $ProductClass1 = $Item1->getProductClass(); |
36 | 36 | $ProductClass2 = $Item2->getProductClass(); |
37 | - $product_class_id1 = $ProductClass1 ? (string)$ProductClass1->getId() : null; |
|
38 | - $product_class_id2 = $ProductClass2 ? (string)$ProductClass2->getId() : null; |
|
37 | + $product_class_id1 = $ProductClass1 ? (string) $ProductClass1->getId() : null; |
|
38 | + $product_class_id2 = $ProductClass2 ? (string) $ProductClass2->getId() : null; |
|
39 | 39 | |
40 | 40 | return $product_class_id1 === $product_class_id2; |
41 | 41 | } |