Code Duplication    Length = 11-11 lines in 2 locations

src/Eccube/Controller/ShoppingController.php 2 locations

@@ 1079-1089 (lines=11) @@
1076
1077
        // 複数配送時は商品毎でお届け先を設定する為、商品をまとめた数量を設定
1078
        $compItemQuantities = array();
1079
        foreach ($Order->getShippings() as $Shipping) {
1080
            foreach ($Shipping->getShipmentItems() as $ShipmentItem) {
1081
                $itemId = $ShipmentItem->getProductClass()->getId();
1082
                $quantity = $ShipmentItem->getQuantity();
1083
                if (array_key_exists($itemId, $compItemQuantities)) {
1084
                    $compItemQuantities[$itemId] = $compItemQuantities[$itemId] + $quantity;
1085
                } else {
1086
                    $compItemQuantities[$itemId] = $quantity;
1087
                }
1088
            }
1089
        }
1090
1091
        // 商品に紐づく商品情報を取得
1092
        $shipmentItems = array();
@@ 1134-1144 (lines=11) @@
1131
            foreach ($data as $mulitples) {
1132
                /** @var \Eccube\Entity\ShipmentItem $multipleItem */
1133
                $multipleItem = $mulitples->getData();
1134
                foreach ($mulitples as $items) {
1135
                    foreach ($items as $item) {
1136
                        $quantity = $item['quantity']->getData();
1137
                        $itemId = $multipleItem->getProductClass()->getId();
1138
                        if (array_key_exists($itemId, $itemQuantities)) {
1139
                            $itemQuantities[$itemId] = $itemQuantities[$itemId] + $quantity;
1140
                        } else {
1141
                            $itemQuantities[$itemId] = $quantity;
1142
                        }
1143
                    }
1144
                }
1145
            }
1146
1147
            foreach ($compItemQuantities as $key => $value) {