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

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