Code Duplication    Length = 14-14 lines in 3 locations

Beanstalkd/JobManager.php 1 location

@@ 65-78 (lines=14) @@
62
        return $job;
63
    }
64
65
    protected function resetJob(RetryableJob $job)
66
    {
67
        if (!$job instanceof Job) {
68
            throw new \InvalidArgumentException('$job must be instance of '.Job::class);
69
        }
70
        $job->setStatus(BaseJob::STATUS_NEW);
71
        $job->setMessage(null);
72
        $job->setStartedAt(null);
73
        $job->setRetries($job->getRetries() + 1);
74
        $job->setUpdatedAt(new \DateTime());
75
        $this->putJob($job);
76
77
        return true;
78
    }
79
80
    public function getBeanJob($jobId, $data)
81
    {

RabbitMQ/JobManager.php 1 location

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

Redis/JobManager.php 1 location

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