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

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

Redis/JobManager.php 1 location

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