Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 805-818 (lines=14) @@
802
    public function addIndex($keys, array $options = array())
803
    {
804
        $this->indexes[] = array(
805
            'keys' => array_map(function($value) {
806
                if ($value == 1 || $value == -1) {
807
                    return (int) $value;
808
                }
809
                if (is_string($value)) {
810
                    $lower = strtolower($value);
811
                    if ($lower === 'asc') {
812
                        return 1;
813
                    } elseif ($lower === 'desc') {
814
                        return -1;
815
                    }
816
                }
817
                return $value;
818
            }, $keys),
819
            'options' => $options
820
        );
821
    }
@@ 892-905 (lines=14) @@
889
        }
890
891
        $this->shardKey = array(
892
            'keys' => array_map(function($value) {
893
                if ($value == 1 || $value == -1) {
894
                    return (int) $value;
895
                }
896
                if (is_string($value)) {
897
                    $lower = strtolower($value);
898
                    if ($lower === 'asc') {
899
                        return 1;
900
                    } elseif ($lower === 'desc') {
901
                        return -1;
902
                    }
903
                }
904
                return $value;
905
            }, $keys),
906
            'options' => $options
907
        );
908
    }