Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 858-871 (lines=14) @@
855
    public function addIndex($keys, array $options = array())
856
    {
857
        $this->indexes[] = array(
858
            'keys' => array_map(function($value) {
859
                if ($value == 1 || $value == -1) {
860
                    return (int) $value;
861
                }
862
                if (is_string($value)) {
863
                    $lower = strtolower($value);
864
                    if ($lower === 'asc') {
865
                        return 1;
866
                    } elseif ($lower === 'desc') {
867
                        return -1;
868
                    }
869
                }
870
                return $value;
871
            }, $keys),
872
            'options' => $options
873
        );
874
    }
@@ 948-961 (lines=14) @@
945
        }
946
947
        $this->shardKey = array(
948
            'keys' => array_map(function($value) {
949
                if ($value == 1 || $value == -1) {
950
                    return (int) $value;
951
                }
952
                if (is_string($value)) {
953
                    $lower = strtolower($value);
954
                    if ($lower === 'asc') {
955
                        return 1;
956
                    } elseif ($lower === 'desc') {
957
                        return -1;
958
                    }
959
                }
960
                return $value;
961
            }, $keys),
962
            'options' => $options
963
        );
964
    }