Code Duplication    Length = 12-12 lines in 2 locations

code/model/Pipeline.php 2 locations

@@ 1038-1049 (lines=12) @@
1035
     *
1036
     * @return DataObject|null The next step in the pipeline, or null if none remain.
1037
     */
1038
    protected function findNextStep()
1039
    {
1040
        // otherwise get next step in chain
1041
        $currentStep = $this->CurrentStep();
1042
1043
        return $this
1044
            ->Steps()
1045
            ->filter("Status", "Queued")
1046
            ->filter("Order:GreaterThanOrEqual", $currentStep->Order)
1047
            ->exclude("ID", $currentStep->ID)
1048
            ->sort("Order ASC")
1049
            ->first();
1050
    }
1051
1052
    /**
@@ 1057-1068 (lines=12) @@
1054
     *
1055
     * @return DataObject|null The previous step in the pipeline, or null if this is the first.
1056
     */
1057
    public function findPreviousStep()
1058
    {
1059
        // otherwise get previous step in chain
1060
        $currentStep = $this->CurrentStep();
1061
1062
        return $this
1063
            ->Steps()
1064
            ->filter("Status", "Finished")
1065
            ->filter("Order:LessThanOrEqual", $currentStep->Order)
1066
            ->exclude("ID", $currentStep->ID)
1067
            ->sort("Order DESC")
1068
            ->first();
1069
    }
1070
1071
    /**