Code Duplication    Length = 13-13 lines in 2 locations

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

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