Code Duplication    Length = 20-21 lines in 2 locations

src/Eccube/Form/Type/Shopping/ShippingType.php 1 location

@@ 123-143 (lines=21) @@
120
                $deliveryDurationFlag = false;
121
122
                // 配送時に最大となる商品日数を取得
123
                foreach ($Shipping->getOrderItems() as $detail) {
124
                    $ProductClass = $detail->getProductClass();
125
                    if (is_null($ProductClass)) {
126
                        continue;
127
                    }
128
                    $deliveryDuration = $ProductClass->getDeliveryDuration();
129
                    if (is_null($deliveryDuration)) {
130
                        continue;
131
                    }
132
                    if ($deliveryDuration->getDuration() < 0) {
133
                        // 配送日数がマイナスの場合はお取り寄せなのでスキップする
134
                        $deliveryDurationFlag = false;
135
                        break;
136
                    }
137
138
                    if ($minDate < $deliveryDuration->getDuration()) {
139
                        $minDate = $deliveryDuration->getDuration();
140
                    }
141
                    // 配送日数が設定されている
142
                    $deliveryDurationFlag = true;
143
                }
144
145
                // 配達最大日数期間を設定
146
                $deliveryDurations = array();

src/Eccube/Service/ShoppingService.php 1 location

@@ 929-948 (lines=20) @@
926
        $deliveryDurationFlag = false;
927
928
        // 配送時に最大となる商品日数を取得
929
        foreach ($Order->getOrderItems() as $item) {
930
            if (!$item->isProduct()) {
931
                continue;
932
            }
933
            $ProductClass = $item->getProductClass();
934
            $deliveryDuration = $ProductClass->getDeliveryDuration();
935
            if (!is_null($deliveryDuration)) {
936
                if ($deliveryDuration->getDuration() < 0) {
937
                    // 配送日数がマイナスの場合はお取り寄せなのでスキップする
938
                    $deliveryDurationFlag = false;
939
                    break;
940
                }
941
942
                if ($minDate < $deliveryDuration->getDuration()) {
943
                    $minDate = $deliveryDuration->getDuration();
944
                }
945
                // 配送日数が設定されている
946
                $deliveryDurationFlag = true;
947
            }
948
        }
949
950
        // 配達最大日数期間を設定
951
        $deliveryDurations = array();