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

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