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

@@ 261-270 (lines=10) @@
258
     * @throws PriorityException
259
     * @throws ClassNotSubclassException
260
     */
261
    protected function validateSaveable(\Dtc\QueueBundle\Model\Job $job)
262
    {
263
        if (null !== $job->getPriority() && null === $this->maxPriority) {
264
            throw new PriorityException('This queue does not support priorities');
265
        }
266
267
        if (!$job instanceof RetryableJob) {
268
            throw new ClassNotSubclassException('Job needs to be instance of '.RetryableJob::class);
269
        }
270
    }
271
272
    public function deleteJob(\Dtc\QueueBundle\Model\Job $job)
273
    {