Code Duplication    Length = 8-9 lines in 3 locations

includes/db/DatabasePostgres.php 1 location

@@ 818-825 (lines=8) @@
815
		if ( $multi ) {
816
			if ( $this->numericVersion >= 8.2 && !$savepoint ) {
817
				$first = true;
818
				foreach ( $args as $row ) {
819
					if ( $first ) {
820
						$first = false;
821
					} else {
822
						$sql .= ',';
823
					}
824
					$sql .= '(' . $this->makeList( $row ) . ')';
825
				}
826
				$res = (bool)$this->query( $sql, $fname, $savepoint );
827
			} else {
828
				$res = true;

includes/db/Database.php 2 locations

@@ 1490-1497 (lines=8) @@
1487
1488
		if ( $multi ) {
1489
			$first = true;
1490
			foreach ( $a as $row ) {
1491
				if ( $first ) {
1492
					$first = false;
1493
				} else {
1494
					$sql .= ',';
1495
				}
1496
				$sql .= '(' . $this->makeList( $row ) . ')';
1497
			}
1498
		} else {
1499
			$sql .= '(' . $this->makeList( $a ) . ')';
1500
		}
@@ 2163-2171 (lines=9) @@
2160
		$sql = "REPLACE INTO $table (" . implode( ',', array_keys( $rows[0] ) ) . ') VALUES ';
2161
		$first = true;
2162
2163
		foreach ( $rows as $row ) {
2164
			if ( $first ) {
2165
				$first = false;
2166
			} else {
2167
				$sql .= ',';
2168
			}
2169
2170
			$sql .= '(' . $this->makeList( $row ) . ')';
2171
		}
2172
2173
		return $this->query( $sql, $fname );
2174
	}