Code Duplication    Length = 17-21 lines in 2 locations

src/Tasks/CreateQueuedJobTask.php 1 location

@@ 105-125 (lines=21) @@
102
        $this->times = array();
103
    }
104
105
    public function process()
106
    {
107
        $times = $this->times;
108
        // needed due to quirks with __set
109
        $times[] = date('Y-m-d H:i:s');
110
        $this->times = $times;
111
112
        $this->addMessage("Updated time to " . date('Y-m-d H:i:s'));
113
        sleep(1);
114
115
        // make sure we're incrementing
116
        $this->currentStep++;
117
118
        // if ($this->currentStep > 1) {
119
        //     $this->currentStep = 1;
120
        // }
121
122
        // and checking whether we're complete
123
        if ($this->currentStep >= $this->totalSteps) {
124
            $this->isComplete = true;
125
        }
126
    }
127
}
128

tests/QueuedJobsTest/TestQueuedJob.php 1 location

@@ 35-51 (lines=17) @@
32
        $this->totalSteps = 5;
33
    }
34
35
    public function process()
36
    {
37
        $times = $this->times;
38
        // needed due to quirks with __set
39
        $times[] = date('Y-m-d H:i:s');
40
        $this->times = $times;
41
42
        $this->addMessage("Updated time to " . date('Y-m-d H:i:s'));
43
        sleep(1);
44
45
        // make sure we're incrementing
46
        $this->currentStep++;
47
48
        // and checking whether we're complete
49
        if ($this->currentStep == 5) {
50
            $this->isComplete = true;
51
        }
52
    }
53
}
54