Code Duplication    Length = 4-4 lines in 3 locations

sdk/ECPay.Logistics.Integration.php 3 locations

@@ 432-435 (lines=4) @@
429
                }
430
            }
431
432
            if ($this->PostParams['LogisticsSubType'] == LogisticsSubType::ECAN and $this->PostParams['Temperature'] !== Temperature::ROOM) {
433
                // 物流子類型為宅配通(ECAN)時,溫層(Temperature)只能用常溫(ROOM)
434
                throw new Exception('Temperature should be ROOM when LogisticsSubType is ECAN.');
435
            }
436
437
            if ($this->PostParams['LogisticsSubType'] == LogisticsSubType::ECAN and date('Ymd', strtotime($this->PostParams['ScheduledDeliveryDate'])) < date('Ymd', strtotime('+3 day'))) {
438
                // 指定送達日期為該訂單建立時間 + 3 天
@@ 623-626 (lines=4) @@
620
                }
621
            }
622
623
            if ($this->PostParams['LogisticsSubType'] == LogisticsSubType::ECAN and $this->PostParams['Temperature'] !== Temperature::ROOM) {
624
                // 物流子類型為宅配通(ECAN)時,溫層(Temperature)只能用常溫(ROOM)
625
                throw new Exception('Temperature should be ROOM when LogisticsSubType is ECAN.');
626
            }
627
628
            if ($this->PostParams['LogisticsSubType'] == LogisticsSubType::ECAN and date('Ymd', strtotime($this->PostParams['ScheduledDeliveryDate'])) < date('Ymd', strtotime('+3 day'))) {
629
                // 指定送達日期為該訂單建立時間 + 3 天
@@ 816-819 (lines=4) @@
813
            // 若物流交易編號(AllPayLogisticsID)為空值時,收件人地址(ReceiverAddress)不可為空。
814
            $this->ValidateAddress('ReceiverAddress', $this->PostParams['ReceiverAddress'], 6, 60, $IsAllowEmpty);
815
816
            if ($this->PostParams['LogisticsSubType'] == LogisticsSubType::ECAN and $this->PostParams['Temperature'] !== Temperature::ROOM) {
817
                // 物流子類型為宅配通(ECAN)時,溫層(Temperature)只能用常溫(ROOM)
818
                throw new Exception('Temperature should be ROOM when LogisticsSubType is ECAN.');
819
            }
820
821
            if ($this->PostParams['LogisticsSubType'] == LogisticsSubType::ECAN and date('Ymd', strtotime($this->PostParams['ScheduledDeliveryDate'])) < date('Ymd', strtotime('+3 day'))) {
822
                // 指定送達日期為該訂單建立時間 + 3 天