Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 874-887 (lines=14) @@
871
    public function addIndex($keys, array $options = array())
872
    {
873
        $this->indexes[] = array(
874
            'keys' => array_map(function($value) {
875
                if ($value == 1 || $value == -1) {
876
                    return (int) $value;
877
                }
878
                if (is_string($value)) {
879
                    $lower = strtolower($value);
880
                    if ($lower === 'asc') {
881
                        return 1;
882
                    } elseif ($lower === 'desc') {
883
                        return -1;
884
                    }
885
                }
886
                return $value;
887
            }, $keys),
888
            'options' => $options
889
        );
890
    }
@@ 964-977 (lines=14) @@
961
        }
962
963
        $this->shardKey = array(
964
            'keys' => array_map(function($value) {
965
                if ($value == 1 || $value == -1) {
966
                    return (int) $value;
967
                }
968
                if (is_string($value)) {
969
                    $lower = strtolower($value);
970
                    if ($lower === 'asc') {
971
                        return 1;
972
                    } elseif ($lower === 'desc') {
973
                        return -1;
974
                    }
975
                }
976
                return $value;
977
            }, $keys),
978
            'options' => $options
979
        );
980
    }