Code Duplication    Length = 6-7 lines in 3 locations

includes/db/Database.php 3 locations

@@ 1359-1364 (lines=6) @@
1356
	 */
1357
	public function makeGroupByWithHaving( $options ) {
1358
		$sql = '';
1359
		if ( isset( $options['GROUP BY'] ) ) {
1360
			$gb = is_array( $options['GROUP BY'] )
1361
				? implode( ',', $options['GROUP BY'] )
1362
				: $options['GROUP BY'];
1363
			$sql .= ' GROUP BY ' . $gb;
1364
		}
1365
		if ( isset( $options['HAVING'] ) ) {
1366
			$having = is_array( $options['HAVING'] )
1367
				? $this->makeList( $options['HAVING'], LIST_AND )
@@ 1365-1370 (lines=6) @@
1362
				: $options['GROUP BY'];
1363
			$sql .= ' GROUP BY ' . $gb;
1364
		}
1365
		if ( isset( $options['HAVING'] ) ) {
1366
			$having = is_array( $options['HAVING'] )
1367
				? $this->makeList( $options['HAVING'], LIST_AND )
1368
				: $options['HAVING'];
1369
			$sql .= ' HAVING ' . $having;
1370
		}
1371
1372
		return $sql;
1373
	}
@@ 1384-1390 (lines=7) @@
1381
	 * @since 1.21
1382
	 */
1383
	public function makeOrderBy( $options ) {
1384
		if ( isset( $options['ORDER BY'] ) ) {
1385
			$ob = is_array( $options['ORDER BY'] )
1386
				? implode( ',', $options['ORDER BY'] )
1387
				: $options['ORDER BY'];
1388
1389
			return ' ORDER BY ' . $ob;
1390
		}
1391
1392
		return '';
1393
	}