Code Duplication    Length = 14-14 lines in 3 locations

Beanstalkd/JobManager.php 1 location

@@ 66-79 (lines=14) @@
63
        return $job;
64
    }
65
66
    protected function resetJob(RetryableJob $job)
67
    {
68
        if (!$job instanceof Job) {
69
            throw new \InvalidArgumentException('$job must be instance of '.Job::class);
70
        }
71
        $job->setStatus(BaseJob::STATUS_NEW);
72
        $job->setMessage(null);
73
        $job->setStartedAt(null);
74
        $job->setRetries($job->getRetries() + 1);
75
        $job->setUpdatedAt(Util::getMicrotimeDateTime());
76
        $this->putJob($job);
77
78
        return true;
79
    }
80
81
    public function getBeanJob($jobId, $data)
82
    {

RabbitMQ/JobManager.php 1 location

@@ 267-280 (lines=14) @@
264
        return null;
265
    }
266
267
    protected function resetJob(RetryableJob $job)
268
    {
269
        if (!$job instanceof Job) {
270
            throw new \InvalidArgumentException('$job must be instance of '.Job::class);
271
        }
272
        $job->setStatus(BaseJob::STATUS_NEW);
273
        $job->setMessage(null);
274
        $job->setStartedAt(null);
275
        $job->setRetries($job->getRetries() + 1);
276
        $job->setUpdatedAt(Util::getMicrotimeDateTime());
277
        $this->publishJob($job);
278
279
        return true;
280
    }
281
282
    // Save History get called upon completion of the job
283
    protected function retryableSaveHistory(RetryableJob $job, $retry)

Redis/JobManager.php 1 location

@@ 405-418 (lines=14) @@
402
        return $time;
403
    }
404
405
    public function resetJob(RetryableJob $job)
406
    {
407
        if (!$job instanceof Job) {
408
            throw new \InvalidArgumentException('$job must be instance of '.Job::class);
409
        }
410
        $job->setStatus(BaseJob::STATUS_NEW);
411
        $job->setMessage(null);
412
        $job->setStartedAt(null);
413
        $job->setRetries($job->getRetries() + 1);
414
        $job->setUpdatedAt(Util::getMicrotimeDateTime());
415
        $this->saveJob($job);
416
417
        return true;
418
    }
419
420
    public function retryableSaveHistory(RetryableJob $job, $retry)
421
    {