Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 812-825 (lines=14) @@
809
    public function addIndex($keys, array $options = array())
810
    {
811
        $this->indexes[] = array(
812
            'keys' => array_map(function($value) {
813
                if ($value == 1 || $value == -1) {
814
                    return (int) $value;
815
                }
816
                if (is_string($value)) {
817
                    $lower = strtolower($value);
818
                    if ($lower === 'asc') {
819
                        return 1;
820
                    } elseif ($lower === 'desc') {
821
                        return -1;
822
                    }
823
                }
824
                return $value;
825
            }, $keys),
826
            'options' => $options
827
        );
828
    }
@@ 899-912 (lines=14) @@
896
        }
897
898
        $this->shardKey = array(
899
            'keys' => array_map(function($value) {
900
                if ($value == 1 || $value == -1) {
901
                    return (int) $value;
902
                }
903
                if (is_string($value)) {
904
                    $lower = strtolower($value);
905
                    if ($lower === 'asc') {
906
                        return 1;
907
                    } elseif ($lower === 'desc') {
908
                        return -1;
909
                    }
910
                }
911
                return $value;
912
            }, $keys),
913
            'options' => $options
914
        );
915
    }