Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 359-371 (lines=13) @@
356
            $options['unique'] = ('true' === (string) $attributes['unique']);
357
        }
358
359
        if (isset($xmlIndex->{'option'})) {
360
            foreach ($xmlIndex->{'option'} as $option) {
361
                $value = (string) $option['value'];
362
                if ($value === 'true') {
363
                    $value = true;
364
                } elseif ($value === 'false') {
365
                    $value = false;
366
                } elseif (is_numeric($value)) {
367
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
368
                }
369
                $options[(string) $option['name']] = $value;
370
            }
371
        }
372
373
        if (isset($xmlIndex->{'partial-filter-expression'})) {
374
            $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'};
@@ 454-466 (lines=13) @@
451
            $options['numInitialChunks'] = (int) $attributes['numInitialChunks'];
452
        }
453
454
        if (isset($xmlShardkey->{'option'})) {
455
            foreach ($xmlShardkey->{'option'} as $option) {
456
                $value = (string) $option['value'];
457
                if ($value === 'true') {
458
                    $value = true;
459
                } elseif ($value === 'false') {
460
                    $value = false;
461
                } elseif (is_numeric($value)) {
462
                    $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value;
463
                }
464
                $options[(string) $option['name']] = $value;
465
            }
466
        }
467
468
        $class->setShardKey($keys, $options);
469
    }