Code Duplication    Length = 13-13 lines in 2 locations

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

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