Code Duplication    Length = 10-10 lines in 2 locations

RabbitMQ/JobManager.php 1 location

@@ 193-202 (lines=10) @@
190
     * @throws PriorityException
191
     * @throws ClassNotSubclassException
192
     */
193
    protected function validateSaveable(\Dtc\QueueBundle\Model\Job $job)
194
    {
195
        if (null !== $job->getPriority() && null === $this->maxPriority) {
196
            throw new PriorityException('This queue does not support priorities');
197
        }
198
199
        if (!$job instanceof Job) {
200
            throw new ClassNotSubclassException('Job needs to be instance of '.Job::class);
201
        }
202
    }
203
204
    /**
205
     * @param string|null $workerName

Redis/JobManager.php 1 location

@@ 321-330 (lines=10) @@
318
     * @throws PriorityException
319
     * @throws ClassNotSubclassException
320
     */
321
    protected function validateSaveable(\Dtc\QueueBundle\Model\Job $job)
322
    {
323
        if (null !== $job->getPriority() && null === $this->maxPriority) {
324
            throw new PriorityException('This queue does not support priorities');
325
        }
326
327
        if (!$job instanceof RetryableJob) {
328
            throw new ClassNotSubclassException('Job needs to be instance of '.RetryableJob::class);
329
        }
330
    }
331
332
    /**
333
     * @param string|null $workerName