Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 818-831 (lines=14) @@
815
    public function addIndex($keys, array $options = array())
816
    {
817
        $this->indexes[] = array(
818
            'keys' => array_map(function($value) {
819
                if ($value == 1 || $value == -1) {
820
                    return (int) $value;
821
                }
822
                if (is_string($value)) {
823
                    $lower = strtolower($value);
824
                    if ($lower === 'asc') {
825
                        return 1;
826
                    } elseif ($lower === 'desc') {
827
                        return -1;
828
                    }
829
                }
830
                return $value;
831
            }, $keys),
832
            'options' => $options
833
        );
834
    }
@@ 889-902 (lines=14) @@
886
        }
887
888
        $this->shardKey = array(
889
            'keys' => array_map(function($value) {
890
                if ($value == 1 || $value == -1) {
891
                    return (int) $value;
892
                }
893
                if (is_string($value)) {
894
                    $lower = strtolower($value);
895
                    if ($lower === 'asc') {
896
                        return 1;
897
                    } elseif ($lower === 'desc') {
898
                        return -1;
899
                    }
900
                }
901
                return $value;
902
            }, $keys),
903
            'options' => $options
904
        );
905
    }