Code Duplication    Length = 13-13 lines in 2 locations

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

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