Code Duplication    Length = 3-3 lines in 2 locations

lib/Doctrine/ORM/EntityManager.php 2 locations

@@ 494-496 (lines=3) @@
491
        }
492
493
        // Check identity map first, if its already in there just return it.
494
        if (($entity = $this->unitOfWork->tryGetById($sortedId, $class->rootEntityName)) !== false) {
495
            return ($entity instanceof $class->name) ? $entity : null;
496
        }
497
498
        if ($class->subClasses) {
499
            return $this->find($entityName, $sortedId);
@@ 517-519 (lines=3) @@
514
        $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
515
516
        // Check identity map first, if its already in there just return it.
517
        if (($entity = $this->unitOfWork->tryGetById($identifier, $class->rootEntityName)) !== false) {
518
            return ($entity instanceof $class->name) ? $entity : null;
519
        }
520
521
        if ( ! is_array($identifier)) {
522
            $identifier = [$class->identifier[0] => $identifier];