Code Duplication    Length = 13-13 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php 2 locations

@@ 217-229 (lines=13) @@
214
            case ClassMetadata::GENERATOR_TYPE_AUTO:
215
                $class->setIdGenerator(new AutoGenerator());
216
                break;
217
            case ClassMetadata::GENERATOR_TYPE_INCREMENT:
218
                $incrementGenerator = new IncrementGenerator();
219
                if (isset($idGenOptions['key'])) {
220
                    $incrementGenerator->setKey($idGenOptions['key']);
221
                }
222
                if (isset($idGenOptions['collection'])) {
223
                    $incrementGenerator->setCollection($idGenOptions['collection']);
224
                }
225
                if (isset($idGenOptions['startingId'])) {
226
                    $incrementGenerator->setStartingId((int) $idGenOptions['startingId']);
227
                }
228
                $class->setIdGenerator($incrementGenerator);
229
                break;
230
            case ClassMetadata::GENERATOR_TYPE_UUID:
231
                $uuidGenerator = new UuidGenerator();
232
                isset($idGenOptions['salt']) && $uuidGenerator->setSalt($idGenOptions['salt']);
@@ 235-247 (lines=13) @@
232
                isset($idGenOptions['salt']) && $uuidGenerator->setSalt($idGenOptions['salt']);
233
                $class->setIdGenerator($uuidGenerator);
234
                break;
235
            case ClassMetadata::GENERATOR_TYPE_ALNUM:
236
                $alnumGenerator = new AlnumGenerator();
237
                if (isset($idGenOptions['pad'])) {
238
                    $alnumGenerator->setPad($idGenOptions['pad']);
239
                }
240
                if (isset($idGenOptions['chars'])) {
241
                    $alnumGenerator->setChars($idGenOptions['chars']);
242
                } elseif (isset($idGenOptions['awkwardSafe'])) {
243
                    $alnumGenerator->setAwkwardSafeMode($idGenOptions['awkwardSafe']);
244
                }
245
246
                $class->setIdGenerator($alnumGenerator);
247
                break;
248
            case ClassMetadata::GENERATOR_TYPE_CUSTOM:
249
                if (empty($idGenOptions['class'])) {
250
                    throw MappingException::missingIdGeneratorClass($class->name);