Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 783-796 (lines=14) @@
780
    public function addIndex($keys, array $options = array())
781
    {
782
        $this->indexes[] = array(
783
            'keys' => array_map(function($value) {
784
                if ($value == 1 || $value == -1) {
785
                    return (int) $value;
786
                }
787
                if (is_string($value)) {
788
                    $lower = strtolower($value);
789
                    if ($lower === 'asc') {
790
                        return 1;
791
                    } elseif ($lower === 'desc') {
792
                        return -1;
793
                    }
794
                }
795
                return $value;
796
            }, $keys),
797
            'options' => $options
798
        );
799
    }
@@ 864-877 (lines=14) @@
861
        }
862
863
        $this->shardKey = array(
864
            'keys' => array_map(function($value) {
865
                if ($value == 1 || $value == -1) {
866
                    return (int) $value;
867
                }
868
                if (is_string($value)) {
869
                    $lower = strtolower($value);
870
                    if ($lower === 'asc') {
871
                        return 1;
872
                    } elseif ($lower === 'desc') {
873
                        return -1;
874
                    }
875
                }
876
                return $value;
877
            }, $keys),
878
            'options' => $options
879
        );
880
    }