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

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

Redis/JobManager.php 1 location

@@ 375-388 (lines=14) @@
372
        return $time;
373
    }
374
375
    public function resetJob(RetryableJob $job)
376
    {
377
        if (!$job instanceof \Dtc\QueueBundle\Redis\Job) {
378
            throw new \InvalidArgumentException('$job must be instance of '.\Dtc\QueueBundle\Redis\Job::class);
379
        }
380
        $job->setStatus(BaseJob::STATUS_NEW);
381
        $job->setMessage(null);
382
        $job->setStartedAt(null);
383
        $job->setRetries($job->getRetries() + 1);
384
        $job->setUpdatedAt(Util::getMicrotimeDateTime());
385
        $this->saveJob($job);
386
387
        return true;
388
    }
389
390
    public function retryableSaveHistory(RetryableJob $job, $retry)
391
    {