Code Duplication    Length = 5-7 lines in 2 locations

lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php 1 location

@@ 682-688 (lines=7) @@
679
            $indexByProperty  = $targetClass->getProperty($indexBy);
680
681
            switch (true) {
682
                case ($indexByProperty instanceof FieldMetadata):
683
                    $quotedColumnName = $this->platform->quoteIdentifier($indexByProperty->getColumnName());
684
685
                    $whereClauses[] = sprintf('tr.%s = ?', $quotedColumnName);
686
                    $params[]       = $key;
687
                    $types[]        = $indexByProperty->getType();
688
                    break;
689
690
                case ($indexByProperty instanceof ToOneAssociationMetadata && $indexByProperty->isOwningSide()):
691
                    // Cannot be supported because PHP does not accept objects as keys. =(

lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php 1 location

@@ 462-466 (lines=5) @@
459
            $property = $this->class->getProperty($idField);
460
461
            switch (true) {
462
                case ($property instanceof FieldMetadata):
463
                    $where[]  = $this->platform->quoteIdentifier($property->getColumnName());
464
                    $params[] = $identifier[$idField];
465
                    $types[]  = $property->getType();
466
                    break;
467
468
                case ($property instanceof ToOneAssociationMetadata):
469
                    $targetClass = $this->em->getClassMetadata($property->getTargetEntity());