Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 867-880 (lines=14) @@
864
    public function addIndex($keys, array $options = array())
865
    {
866
        $this->indexes[] = array(
867
            'keys' => array_map(function($value) {
868
                if ($value == 1 || $value == -1) {
869
                    return (int) $value;
870
                }
871
                if (is_string($value)) {
872
                    $lower = strtolower($value);
873
                    if ($lower === 'asc') {
874
                        return 1;
875
                    } elseif ($lower === 'desc') {
876
                        return -1;
877
                    }
878
                }
879
                return $value;
880
            }, $keys),
881
            'options' => $options
882
        );
883
    }
@@ 938-951 (lines=14) @@
935
        }
936
937
        $this->shardKey = array(
938
            'keys' => array_map(function($value) {
939
                if ($value == 1 || $value == -1) {
940
                    return (int) $value;
941
                }
942
                if (is_string($value)) {
943
                    $lower = strtolower($value);
944
                    if ($lower === 'asc') {
945
                        return 1;
946
                    } elseif ($lower === 'desc') {
947
                        return -1;
948
                    }
949
                }
950
                return $value;
951
            }, $keys),
952
            'options' => $options
953
        );
954
    }