Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 834-847 (lines=14) @@
831
    public function addIndex($keys, array $options = array())
832
    {
833
        $this->indexes[] = array(
834
            'keys' => array_map(function($value) {
835
                if ($value == 1 || $value == -1) {
836
                    return (int) $value;
837
                }
838
                if (is_string($value)) {
839
                    $lower = strtolower($value);
840
                    if ($lower === 'asc') {
841
                        return 1;
842
                    } elseif ($lower === 'desc') {
843
                        return -1;
844
                    }
845
                }
846
                return $value;
847
            }, $keys),
848
            'options' => $options
849
        );
850
    }
@@ 921-934 (lines=14) @@
918
        }
919
920
        $this->shardKey = array(
921
            'keys' => array_map(function($value) {
922
                if ($value == 1 || $value == -1) {
923
                    return (int) $value;
924
                }
925
                if (is_string($value)) {
926
                    $lower = strtolower($value);
927
                    if ($lower === 'asc') {
928
                        return 1;
929
                    } elseif ($lower === 'desc') {
930
                        return -1;
931
                    }
932
                }
933
                return $value;
934
            }, $keys),
935
            'options' => $options
936
        );
937
    }