Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 855-868 (lines=14) @@
852
    public function addIndex($keys, array $options = array())
853
    {
854
        $this->indexes[] = array(
855
            'keys' => array_map(function($value) {
856
                if ($value == 1 || $value == -1) {
857
                    return (int) $value;
858
                }
859
                if (is_string($value)) {
860
                    $lower = strtolower($value);
861
                    if ($lower === 'asc') {
862
                        return 1;
863
                    } elseif ($lower === 'desc') {
864
                        return -1;
865
                    }
866
                }
867
                return $value;
868
            }, $keys),
869
            'options' => $options
870
        );
871
    }
@@ 942-955 (lines=14) @@
939
        }
940
941
        $this->shardKey = array(
942
            'keys' => array_map(function($value) {
943
                if ($value == 1 || $value == -1) {
944
                    return (int) $value;
945
                }
946
                if (is_string($value)) {
947
                    $lower = strtolower($value);
948
                    if ($lower === 'asc') {
949
                        return 1;
950
                    } elseif ($lower === 'desc') {
951
                        return -1;
952
                    }
953
                }
954
                return $value;
955
            }, $keys),
956
            'options' => $options
957
        );
958
    }