Code Duplication    Length = 13-13 lines in 2 locations

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

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