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

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