Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 797-810 (lines=14) @@
794
    public function addIndex($keys, array $options = array())
795
    {
796
        $this->indexes[] = array(
797
            'keys' => array_map(function($value) {
798
                if ($value == 1 || $value == -1) {
799
                    return (int) $value;
800
                }
801
                if (is_string($value)) {
802
                    $lower = strtolower($value);
803
                    if ($lower === 'asc') {
804
                        return 1;
805
                    } elseif ($lower === 'desc') {
806
                        return -1;
807
                    }
808
                }
809
                return $value;
810
            }, $keys),
811
            'options' => $options
812
        );
813
    }
@@ 880-893 (lines=14) @@
877
        }
878
879
        $this->shardKey = array(
880
            'keys' => array_map(function($value) {
881
                if ($value == 1 || $value == -1) {
882
                    return (int) $value;
883
                }
884
                if (is_string($value)) {
885
                    $lower = strtolower($value);
886
                    if ($lower === 'asc') {
887
                        return 1;
888
                    } elseif ($lower === 'desc') {
889
                        return -1;
890
                    }
891
                }
892
                return $value;
893
            }, $keys),
894
            'options' => $options
895
        );
896
    }