Code Duplication    Length = 14-14 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php 2 locations

@@ 788-801 (lines=14) @@
785
    public function addIndex($keys, array $options = array())
786
    {
787
        $this->indexes[] = array(
788
            'keys' => array_map(function($value) {
789
                if ($value == 1 || $value == -1) {
790
                    return (int) $value;
791
                }
792
                if (is_string($value)) {
793
                    $lower = strtolower($value);
794
                    if ($lower === 'asc') {
795
                        return 1;
796
                    } elseif ($lower === 'desc') {
797
                        return -1;
798
                    }
799
                }
800
                return $value;
801
            }, $keys),
802
            'options' => $options
803
        );
804
    }
@@ 869-882 (lines=14) @@
866
        }
867
868
        $this->shardKey = array(
869
            'keys' => array_map(function($value) {
870
                if ($value == 1 || $value == -1) {
871
                    return (int) $value;
872
                }
873
                if (is_string($value)) {
874
                    $lower = strtolower($value);
875
                    if ($lower === 'asc') {
876
                        return 1;
877
                    } elseif ($lower === 'desc') {
878
                        return -1;
879
                    }
880
                }
881
                return $value;
882
            }, $keys),
883
            'options' => $options
884
        );
885
    }