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

@@ 355-368 (lines=14) @@
352
        return $time;
353
    }
354
355
    public function resetJob(RetryableJob $job)
356
    {
357
        if (!$job instanceof \Dtc\QueueBundle\Redis\Job) {
358
            throw new \InvalidArgumentException('$job must be instance of '.\Dtc\QueueBundle\Redis\Job::class);
359
        }
360
        $job->setStatus(BaseJob::STATUS_NEW);
361
        $job->setMessage(null);
362
        $job->setStartedAt(null);
363
        $job->setRetries($job->getRetries() + 1);
364
        $job->setUpdatedAt(Util::getMicrotimeDateTime());
365
        $this->saveJob($job);
366
367
        return true;
368
    }
369
370
    public function retryableSaveHistory(RetryableJob $job, $retry)
371
    {