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
    }
@@ 945-958 (lines=14) @@
942
        }
943
944
        $this->shardKey = array(
945
            'keys' => array_map(function($value) {
946
                if ($value == 1 || $value == -1) {
947
                    return (int) $value;
948
                }
949
                if (is_string($value)) {
950
                    $lower = strtolower($value);
951
                    if ($lower === 'asc') {
952
                        return 1;
953
                    } elseif ($lower === 'desc') {
954
                        return -1;
955
                    }
956
                }
957
                return $value;
958
            }, $keys),
959
            'options' => $options
960
        );
961
    }