Code Duplication    Length = 11-11 lines in 2 locations

src/Eccube/Controller/ShoppingController.php 2 locations

@@ 856-866 (lines=11) @@
853
854
        // 複数配送時は商品毎でお届け先を設定する為、商品をまとめた数量を設定
855
        $compItemQuantities = array();
856
        foreach ($Order->getShippings() as $Shipping) {
857
            foreach ($Shipping->getShipmentItems() as $ShipmentItem) {
858
                $itemId = $ShipmentItem->getProductClass()->getId();
859
                $quantity = $ShipmentItem->getQuantity();
860
                if (array_key_exists($itemId, $compItemQuantities)) {
861
                    $compItemQuantities[$itemId] = $compItemQuantities[$itemId] + $quantity;
862
                } else {
863
                    $compItemQuantities[$itemId] = $quantity;
864
                }
865
            }
866
        }
867
868
        // 商品に紐づく商品情報を取得
869
        $shipmentItems = array();
@@ 899-909 (lines=11) @@
896
            foreach ($data as $mulitples) {
897
                /** @var \Eccube\Entity\ShipmentItem $multipleItem */
898
                $multipleItem = $mulitples->getData();
899
                foreach ($mulitples as $items) {
900
                    foreach ($items as $item) {
901
                        $quantity = $item['quantity']->getData();
902
                        $itemId = $multipleItem->getProductClass()->getId();
903
                        if (array_key_exists($itemId, $itemQuantities)) {
904
                            $itemQuantities[$itemId] = $itemQuantities[$itemId] + $quantity;
905
                        } else {
906
                            $itemQuantities[$itemId] = $quantity;
907
                        }
908
                    }
909
                }
910
            }
911
912
            foreach ($compItemQuantities as $key => $value) {