Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 383-395 (lines=13) @@
380
            $options['unique'] = ('true' === (string) $attributes['unique']);
381
        }
382
383
        if (isset($xmlIndex->{'option'})) {
384
            foreach ($xmlIndex->{'option'} as $option) {
385
                $value = (string) $option['value'];
386
                if ($value === 'true') {
387
                    $value = true;
388
                } elseif ($value === 'false') {
389
                    $value = false;
390
                } elseif (is_numeric($value)) {
391
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
392
                }
393
                $options[(string) $option['name']] = $value;
394
            }
395
        }
396
397
        if (isset($xmlIndex->{'partial-filter-expression'})) {
398
            $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'};
@@ 478-490 (lines=13) @@
475
            $options['numInitialChunks'] = (int) $attributes['numInitialChunks'];
476
        }
477
478
        if (isset($xmlShardkey->{'option'})) {
479
            foreach ($xmlShardkey->{'option'} as $option) {
480
                $value = (string) $option['value'];
481
                if ($value === 'true') {
482
                    $value = true;
483
                } elseif ($value === 'false') {
484
                    $value = false;
485
                } elseif (is_numeric($value)) {
486
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
487
                }
488
                $options[(string) $option['name']] = $value;
489
            }
490
        }
491
492
        $class->setShardKey($keys, $options);
493
    }