Code Duplication    Length = 12-12 lines in 2 locations

code/model/RepeatOrder.php 2 locations

@@ 744-755 (lines=12) @@
741
    {
742
        return $this->getTodaysOrderDate();
743
    }
744
    public function getTodaysOrderDate()
745
    {
746
        $a = $this->workOutSchedule();
747
        $today = strtotime(Date("Y-m-d"));
748
        if (count($a)) {
749
            foreach ($a as $orderDateInteger => $orderDateLong) {
750
                if ($orderDateInteger == $today) {
751
                    return Date::create($className = "Date", $value = Date("Y-m-d", $orderDateInteger));
752
                }
753
            }
754
        }
755
    }
756
757
    /**
758
     * Next date (from the viewpoint of today)
@@ 766-777 (lines=12) @@
763
    {
764
        return $this->getNextOrderDate();
765
    }
766
    public function getNextOrderDate()
767
    {
768
        $a = $this->workOutSchedule();
769
        $today = strtotime(Date("Y-m-d"));
770
        if (count($a)) {
771
            foreach ($a as $orderDateInteger => $orderDateLong) {
772
                if ($orderDateInteger > $today) {
773
                    return Date::create($className = "Date", $value = Date("Y-m-d", $orderDateInteger));
774
                }
775
            }
776
        }
777
    }
778
779
780
    /**