Code Duplication    Length = 8-8 lines in 2 locations

lib/Doctrine/ORM/EntityManager.php 2 locations

@@ 410-417 (lines=8) @@
407
408
        $sortedId = [];
409
410
        foreach ($class->identifier as $identifier) {
411
            if ( ! isset($id[$identifier])) {
412
                throw ORMException::missingIdentifierField($class->name, $identifier);
413
            }
414
415
            $sortedId[$identifier] = $id[$identifier];
416
            unset($id[$identifier]);
417
        }
418
419
        if ($id) {
420
            throw ORMException::unrecognizedIdentifierFields($class->name, array_keys($id));
@@ 487-494 (lines=8) @@
484
485
        $sortedId = [];
486
487
        foreach ($class->identifier as $identifier) {
488
            if ( ! isset($id[$identifier])) {
489
                throw ORMException::missingIdentifierField($class->name, $identifier);
490
            }
491
492
            $sortedId[$identifier] = $id[$identifier];
493
            unset($id[$identifier]);
494
        }
495
496
        if ($id) {
497
            throw ORMException::unrecognizedIdentifierFields($class->name, array_keys($id));