Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 807-820 (lines=14) @@
804
    public function addIndex($keys, array $options = array())
805
    {
806
        $this->indexes[] = array(
807
            'keys' => array_map(function($value) {
808
                if ($value == 1 || $value == -1) {
809
                    return (int) $value;
810
                }
811
                if (is_string($value)) {
812
                    $lower = strtolower($value);
813
                    if ($lower === 'asc') {
814
                        return 1;
815
                    } elseif ($lower === 'desc') {
816
                        return -1;
817
                    }
818
                }
819
                return $value;
820
            }, $keys),
821
            'options' => $options
822
        );
823
    }
@@ 878-891 (lines=14) @@
875
        }
876
877
        $this->shardKey = array(
878
            'keys' => array_map(function($value) {
879
                if ($value == 1 || $value == -1) {
880
                    return (int) $value;
881
                }
882
                if (is_string($value)) {
883
                    $lower = strtolower($value);
884
                    if ($lower === 'asc') {
885
                        return 1;
886
                    } elseif ($lower === 'desc') {
887
                        return -1;
888
                    }
889
                }
890
                return $value;
891
            }, $keys),
892
            'options' => $options
893
        );
894
    }