Code Duplication    Length = 4-4 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Query/ReferencePrimer.php 2 locations

@@ 258-261 (lines=4) @@
255
    {
256
        $mapping = $persistentCollection->getMapping();
257
258
        if ($mapping['storeAs'] === ClassMetadataInfo::REFERENCE_STORE_AS_ID) {
259
            $className = $mapping['targetDocument'];
260
            $class = $this->dm->getClassMetadata($className);
261
        }
262
263
        foreach ($persistentCollection->getMongoData() as $reference) {
264
            $id = ClassMetadataInfo::getReferenceId($reference, $mapping['storeAs']);
@@ 266-269 (lines=4) @@
263
        foreach ($persistentCollection->getMongoData() as $reference) {
264
            $id = ClassMetadataInfo::getReferenceId($reference, $mapping['storeAs']);
265
266
            if ($mapping['storeAs'] !== ClassMetadataInfo::REFERENCE_STORE_AS_ID) {
267
                $className = $this->uow->getClassNameForAssociation($mapping, $reference);
268
                $class = $this->dm->getClassMetadata($className);
269
            }
270
271
            $document = $this->uow->tryGetById($id, $class);
272