Code Duplication    Length = 14-14 lines in 4 locations

lib/Doctrine/DBAL/Query/QueryBuilder.php 4 locations

@@ 803-816 (lines=14) @@
800
     *
801
     * @see where()
802
     */
803
    public function andWhere($where)
804
    {
805
        $args = func_get_args();
806
        $where = $this->getQueryPart('where');
807
808
        if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) {
809
            $where->addMultiple($args);
810
        } else {
811
            array_unshift($args, $where);
812
            $where = new CompositeExpression(CompositeExpression::TYPE_AND, $args);
813
        }
814
815
        return $this->add('where', $where, true);
816
    }
817
818
    /**
819
     * Adds one or more restrictions to the query results, forming a logical
@@ 836-849 (lines=14) @@
833
     *
834
     * @see where()
835
     */
836
    public function orWhere($where)
837
    {
838
        $args = func_get_args();
839
        $where = $this->getQueryPart('where');
840
841
        if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) {
842
            $where->addMultiple($args);
843
        } else {
844
            array_unshift($args, $where);
845
            $where = new CompositeExpression(CompositeExpression::TYPE_OR, $args);
846
        }
847
848
        return $this->add('where', $where, true);
849
    }
850
851
    /**
852
     * Specifies a grouping over the results of the query.
@@ 979-992 (lines=14) @@
976
     *
977
     * @return $this This QueryBuilder instance.
978
     */
979
    public function andHaving($having)
980
    {
981
        $args = func_get_args();
982
        $having = $this->getQueryPart('having');
983
984
        if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) {
985
            $having->addMultiple($args);
986
        } else {
987
            array_unshift($args, $having);
988
            $having = new CompositeExpression(CompositeExpression::TYPE_AND, $args);
989
        }
990
991
        return $this->add('having', $having);
992
    }
993
994
    /**
995
     * Adds a restriction over the groups of the query, forming a logical
@@ 1002-1015 (lines=14) @@
999
     *
1000
     * @return $this This QueryBuilder instance.
1001
     */
1002
    public function orHaving($having)
1003
    {
1004
        $args = func_get_args();
1005
        $having = $this->getQueryPart('having');
1006
1007
        if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) {
1008
            $having->addMultiple($args);
1009
        } else {
1010
            array_unshift($args, $having);
1011
            $having = new CompositeExpression(CompositeExpression::TYPE_OR, $args);
1012
        }
1013
1014
        return $this->add('having', $having);
1015
    }
1016
1017
    /**
1018
     * Specifies an ordering for the query results.