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

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