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
    }
@@ 884-897 (lines=14) @@
881
        }
882
883
        $this->shardKey = array(
884
            'keys' => array_map(function($value) {
885
                if ($value == 1 || $value == -1) {
886
                    return (int) $value;
887
                }
888
                if (is_string($value)) {
889
                    $lower = strtolower($value);
890
                    if ($lower === 'asc') {
891
                        return 1;
892
                    } elseif ($lower === 'desc') {
893
                        return -1;
894
                    }
895
                }
896
                return $value;
897
            }, $keys),
898
            'options' => $options
899
        );
900
    }