Code Duplication    Length = 18-19 lines in 2 locations

src/Eccube/Repository/DeliveryRepository.php 1 location

@@ 62-79 (lines=18) @@
59
     * @param \Eccube\Entity\Master\ProductType $ProductType
60
     * @return \Eccube\Entity\Delivery
61
     */
62
    private function createDelivery($Creator, $ProductType)
63
    {
64
        $DeliveryOld = $this->findOneBy(array(), array('rank' => 'DESC'));
65
66
        $rank = 1;
67
        if ($DeliveryOld) {
68
            $rank = $DeliveryOld->getRank() + 1;
69
        }
70
71
        $Delivery = new \Eccube\Entity\Delivery();
72
        $Delivery
73
            ->setRank($rank)
74
            ->setDelFlg(0)
75
            ->setCreator($Creator)
76
            ->setProductType($ProductType);
77
78
        return $Delivery;
79
    }
80
81
    /**
82
     * 複数の商品種別から配送業者を取得

src/Eccube/Repository/PaymentRepository.php 1 location

@@ 59-77 (lines=19) @@
56
     * @param \Eccube\Entity\Member $Creator
57
     * @return \Eccube\Entity\Payment
58
     */
59
    private function createPayment($Creator)
60
    {
61
        $PaymentOld = $this->findOneBy(array(), array('rank' => 'DESC'));
62
63
        $rank = 1;
64
        if ($PaymentOld) {
65
            $rank = $PaymentOld->getRank() + 1;
66
        }
67
68
        $Payment = new \Eccube\Entity\Payment();
69
        $Payment
70
            ->setRank($rank)
71
            ->setDelFlg(0)
72
            ->setFixFlg(1)
73
            ->setChargeFlg(1)
74
            ->setCreator($Creator);
75
76
        return $Payment;
77
    }
78
79
    public function findAllArray()
80
    {