Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 838-851 (lines=14) @@
835
    public function addIndex($keys, array $options = array())
836
    {
837
        $this->indexes[] = array(
838
            'keys' => array_map(function($value) {
839
                if ($value == 1 || $value == -1) {
840
                    return (int) $value;
841
                }
842
                if (is_string($value)) {
843
                    $lower = strtolower($value);
844
                    if ($lower === 'asc') {
845
                        return 1;
846
                    } elseif ($lower === 'desc') {
847
                        return -1;
848
                    }
849
                }
850
                return $value;
851
            }, $keys),
852
            'options' => $options
853
        );
854
    }
@@ 909-922 (lines=14) @@
906
        }
907
908
        $this->shardKey = array(
909
            'keys' => array_map(function($value) {
910
                if ($value == 1 || $value == -1) {
911
                    return (int) $value;
912
                }
913
                if (is_string($value)) {
914
                    $lower = strtolower($value);
915
                    if ($lower === 'asc') {
916
                        return 1;
917
                    } elseif ($lower === 'desc') {
918
                        return -1;
919
                    }
920
                }
921
                return $value;
922
            }, $keys),
923
            'options' => $options
924
        );
925
    }