Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 829-842 (lines=14) @@
826
    public function addIndex($keys, array $options = array())
827
    {
828
        $this->indexes[] = array(
829
            'keys' => array_map(function($value) {
830
                if ($value == 1 || $value == -1) {
831
                    return (int) $value;
832
                }
833
                if (is_string($value)) {
834
                    $lower = strtolower($value);
835
                    if ($lower === 'asc') {
836
                        return 1;
837
                    } elseif ($lower === 'desc') {
838
                        return -1;
839
                    }
840
                }
841
                return $value;
842
            }, $keys),
843
            'options' => $options
844
        );
845
    }
@@ 916-929 (lines=14) @@
913
        }
914
915
        $this->shardKey = array(
916
            'keys' => array_map(function($value) {
917
                if ($value == 1 || $value == -1) {
918
                    return (int) $value;
919
                }
920
                if (is_string($value)) {
921
                    $lower = strtolower($value);
922
                    if ($lower === 'asc') {
923
                        return 1;
924
                    } elseif ($lower === 'desc') {
925
                        return -1;
926
                    }
927
                }
928
                return $value;
929
            }, $keys),
930
            'options' => $options
931
        );
932
    }