Code Duplication    Length = 14-14 lines in 4 locations

lib/Doctrine/ORM/QueryBuilder.php 4 locations

@@ 1092-1105 (lines=14) @@
1089
     *
1090
     * @see where()
1091
     */
1092
    public function andWhere()
1093
    {
1094
        $args  = func_get_args();
1095
        $where = $this->getDQLPart('where');
1096
1097
        if ($where instanceof Expr\Andx) {
1098
            $where->addMultiple($args);
1099
        } else {
1100
            array_unshift($args, $where);
1101
            $where = new Expr\Andx($args);
1102
        }
1103
1104
        return $this->add('where', $where);
1105
    }
1106
1107
    /**
1108
     * Adds one or more restrictions to the query results, forming a logical
@@ 1125-1138 (lines=14) @@
1122
     *
1123
     * @see where()
1124
     */
1125
    public function orWhere()
1126
    {
1127
        $args  = func_get_args();
1128
        $where = $this->getDQLPart('where');
1129
1130
        if ($where instanceof Expr\Orx) {
1131
            $where->addMultiple($args);
1132
        } else {
1133
            array_unshift($args, $where);
1134
            $where = new Expr\Orx($args);
1135
        }
1136
1137
        return $this->add('where', $where);
1138
    }
1139
1140
    /**
1141
     * Specifies a grouping over the results of the query.
@@ 1205-1218 (lines=14) @@
1202
     *
1203
     * @return self
1204
     */
1205
    public function andHaving($having)
1206
    {
1207
        $args   = func_get_args();
1208
        $having = $this->getDQLPart('having');
1209
1210
        if ($having instanceof Expr\Andx) {
1211
            $having->addMultiple($args);
1212
        } else {
1213
            array_unshift($args, $having);
1214
            $having = new Expr\Andx($args);
1215
        }
1216
1217
        return $this->add('having', $having);
1218
    }
1219
1220
    /**
1221
     * Adds a restriction over the groups of the query, forming a logical
@@ 1228-1241 (lines=14) @@
1225
     *
1226
     * @return self
1227
     */
1228
    public function orHaving($having)
1229
    {
1230
        $args   = func_get_args();
1231
        $having = $this->getDQLPart('having');
1232
1233
        if ($having instanceof Expr\Orx) {
1234
            $having->addMultiple($args);
1235
        } else {
1236
            array_unshift($args, $having);
1237
            $having = new Expr\Orx($args);
1238
        }
1239
1240
        return $this->add('having', $having);
1241
    }
1242
1243
    /**
1244
     * Specifies an ordering for the query results.