Code Duplication    Length = 13-13 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php 2 locations

@@ 357-369 (lines=13) @@
354
            $options['unique'] = ('true' === (string) $attributes['unique']);
355
        }
356
357
        if (isset($xmlIndex->{'option'})) {
358
            foreach ($xmlIndex->{'option'} as $option) {
359
                $value = (string) $option['value'];
360
                if ($value === 'true') {
361
                    $value = true;
362
                } elseif ($value === 'false') {
363
                    $value = false;
364
                } elseif (is_numeric($value)) {
365
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
366
                }
367
                $options[(string) $option['name']] = $value;
368
            }
369
        }
370
371
        if (isset($xmlIndex->{'partial-filter-expression'})) {
372
            $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'};
@@ 452-464 (lines=13) @@
449
            $options['numInitialChunks'] = (int) $attributes['numInitialChunks'];
450
        }
451
452
        if (isset($xmlShardkey->{'option'})) {
453
            foreach ($xmlShardkey->{'option'} as $option) {
454
                $value = (string) $option['value'];
455
                if ($value === 'true') {
456
                    $value = true;
457
                } elseif ($value === 'false') {
458
                    $value = false;
459
                } elseif (is_numeric($value)) {
460
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
461
                }
462
                $options[(string) $option['name']] = $value;
463
            }
464
        }
465
466
        $class->setShardKey($keys, $options);
467
    }