Code Duplication    Length = 7-7 lines in 2 locations

Doctrine/BaseJobManager.php 2 locations

@@ 327-333 (lines=7) @@
324
        }
325
326
        // Just save a new job
327
        if (!$job->getId() && $objectManager instanceof EntityManager) {
328
            if (null !== self::$resetInsertCalled && spl_object_hash($objectManager) === self::$resetInsertCalled) {
329
                // Insert SQL is cached...
330
                throw new \Exception("Can't call save and reset within the same process cycle");
331
            }
332
            self::$saveInsertCalled = spl_object_hash($objectManager);
333
        }
334
        $objectManager->persist($job);
335
        $objectManager->flush();
336
@@ 357-363 (lines=7) @@
354
        $offset)
355
    {
356
        $objectManager = $this->getObjectManager();
357
        if ($objectManager instanceof EntityManager) {
358
            if (null !== self::$saveInsertCalled && spl_object_hash($objectManager) === self::$saveInsertCalled) {
359
                // Insert SQL is cached...
360
                throw new \Exception("Can't call reset and save within the same process cycle");
361
            }
362
            self::$resetInsertCalled = spl_object_hash($objectManager);
363
        }
364
365
        $objectName = $this->getObjectName();
366
        $archiveObjectName = $this->getArchiveObjectName();