Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 848-861 (lines=14) @@
845
    public function addIndex($keys, array $options = array())
846
    {
847
        $this->indexes[] = array(
848
            'keys' => array_map(function($value) {
849
                if ($value == 1 || $value == -1) {
850
                    return (int) $value;
851
                }
852
                if (is_string($value)) {
853
                    $lower = strtolower($value);
854
                    if ($lower === 'asc') {
855
                        return 1;
856
                    } elseif ($lower === 'desc') {
857
                        return -1;
858
                    }
859
                }
860
                return $value;
861
            }, $keys),
862
            'options' => $options
863
        );
864
    }
@@ 935-948 (lines=14) @@
932
        }
933
934
        $this->shardKey = array(
935
            'keys' => array_map(function($value) {
936
                if ($value == 1 || $value == -1) {
937
                    return (int) $value;
938
                }
939
                if (is_string($value)) {
940
                    $lower = strtolower($value);
941
                    if ($lower === 'asc') {
942
                        return 1;
943
                    } elseif ($lower === 'desc') {
944
                        return -1;
945
                    }
946
                }
947
                return $value;
948
            }, $keys),
949
            'options' => $options
950
        );
951
    }