Code Duplication    Length = 13-13 lines in 2 locations

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

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