Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 373-385 (lines=13) @@
370
            $options['unique'] = ('true' === (string) $attributes['unique']);
371
        }
372
373
        if (isset($xmlIndex->{'option'})) {
374
            foreach ($xmlIndex->{'option'} as $option) {
375
                $value = (string) $option['value'];
376
                if ($value === 'true') {
377
                    $value = true;
378
                } elseif ($value === 'false') {
379
                    $value = false;
380
                } elseif (is_numeric($value)) {
381
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
382
                }
383
                $options[(string) $option['name']] = $value;
384
            }
385
        }
386
387
        if (isset($xmlIndex->{'partial-filter-expression'})) {
388
            $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'};
@@ 468-480 (lines=13) @@
465
            $options['numInitialChunks'] = (int) $attributes['numInitialChunks'];
466
        }
467
468
        if (isset($xmlShardkey->{'option'})) {
469
            foreach ($xmlShardkey->{'option'} as $option) {
470
                $value = (string) $option['value'];
471
                if ($value === 'true') {
472
                    $value = true;
473
                } elseif ($value === 'false') {
474
                    $value = false;
475
                } elseif (is_numeric($value)) {
476
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
477
                }
478
                $options[(string) $option['name']] = $value;
479
            }
480
        }
481
482
        $class->setShardKey($keys, $options);
483
    }