Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 866-879 (lines=14) @@
863
    public function addIndex($keys, array $options = array())
864
    {
865
        $this->indexes[] = array(
866
            'keys' => array_map(function($value) {
867
                if ($value == 1 || $value == -1) {
868
                    return (int) $value;
869
                }
870
                if (is_string($value)) {
871
                    $lower = strtolower($value);
872
                    if ($lower === 'asc') {
873
                        return 1;
874
                    } elseif ($lower === 'desc') {
875
                        return -1;
876
                    }
877
                }
878
                return $value;
879
            }, $keys),
880
            'options' => $options
881
        );
882
    }
@@ 953-966 (lines=14) @@
950
        }
951
952
        $this->shardKey = array(
953
            'keys' => array_map(function($value) {
954
                if ($value == 1 || $value == -1) {
955
                    return (int) $value;
956
                }
957
                if (is_string($value)) {
958
                    $lower = strtolower($value);
959
                    if ($lower === 'asc') {
960
                        return 1;
961
                    } elseif ($lower === 'desc') {
962
                        return -1;
963
                    }
964
                }
965
                return $value;
966
            }, $keys),
967
            'options' => $options
968
        );
969
    }