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
    }
@@ 926-939 (lines=14) @@
923
        }
924
925
        $this->shardKey = array(
926
            'keys' => array_map(function($value) {
927
                if ($value == 1 || $value == -1) {
928
                    return (int) $value;
929
                }
930
                if (is_string($value)) {
931
                    $lower = strtolower($value);
932
                    if ($lower === 'asc') {
933
                        return 1;
934
                    } elseif ($lower === 'desc') {
935
                        return -1;
936
                    }
937
                }
938
                return $value;
939
            }, $keys),
940
            'options' => $options
941
        );
942
    }