Code Duplication    Length = 9-12 lines in 2 locations

code/model/RepeatOrder.php 2 locations

@@ 601-609 (lines=9) @@
598
        return $this->getFirstOrderDate();
599
    }
600
601
    public function getFirstOrderDate()
602
    {
603
        $a = $this->workOutSchedule();
604
        if (count($a)) {
605
            foreach ($a as $orderDateInteger => $orderDateLong) {
606
                return Date::create($className = "Date", $value = Date("Y-m-d", $orderDateInteger));
607
            }
608
        }
609
    }
610
611
    /**
612
     * Last date that an order was placed
@@ 704-715 (lines=12) @@
701
        return $this->getFinalOrderDate();
702
    }
703
704
    public function getFinalOrderDate()
705
    {
706
        $a = $this->workOutSchedule();
707
        if (count($a)) {
708
            foreach ($a as $orderDateInteger => $orderDateLong) {
709
                //do nothing wait for last one...
710
            }
711
            if ($orderDateInteger) {
712
                return Date::create($className = "Date", $value = Date("Y-m-d", $orderDateInteger));
713
            }
714
        }
715
    }
716
717
    /**
718
     * List of delivery dates