Code Duplication    Length = 10-10 lines in 2 locations

RabbitMQ/JobManager.php 1 location

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

Redis/JobManager.php 1 location

@@ 273-282 (lines=10) @@
270
     * @throws PriorityException
271
     * @throws ClassNotSubclassException
272
     */
273
    protected function validateSaveable(\Dtc\QueueBundle\Model\Job $job)
274
    {
275
        if (null !== $job->getPriority() && null === $this->maxPriority) {
276
            throw new PriorityException('This queue does not support priorities');
277
        }
278
279
        if (!$job instanceof RetryableJob) {
280
            throw new ClassNotSubclassException('Job needs to be instance of '.RetryableJob::class);
281
        }
282
    }
283
284
    /**
285
     * @param string|null $workerName