Code Duplication    Length = 8-9 lines in 3 locations

includes/libs/rdbms/database/Database.php 2 locations

@@ 1432-1439 (lines=8) @@
1429
1430
		if ( $multi ) {
1431
			$first = true;
1432
			foreach ( $a as $row ) {
1433
				if ( $first ) {
1434
					$first = false;
1435
				} else {
1436
					$sql .= ',';
1437
				}
1438
				$sql .= '(' . $this->makeList( $row ) . ')';
1439
			}
1440
		} else {
1441
			$sql .= '(' . $this->makeList( $a ) . ')';
1442
		}
@@ 2146-2154 (lines=9) @@
2143
		$sql = "REPLACE INTO $table (" . implode( ',', array_keys( $rows[0] ) ) . ') VALUES ';
2144
		$first = true;
2145
2146
		foreach ( $rows as $row ) {
2147
			if ( $first ) {
2148
				$first = false;
2149
			} else {
2150
				$sql .= ',';
2151
			}
2152
2153
			$sql .= '(' . $this->makeList( $row ) . ')';
2154
		}
2155
2156
		return $this->query( $sql, $fname );
2157
	}

includes/libs/rdbms/database/DatabasePostgres.php 1 location

@@ 610-617 (lines=8) @@
607
		if ( $multi ) {
608
			if ( $this->numericVersion >= 8.2 && !$savepoint ) {
609
				$first = true;
610
				foreach ( $args as $row ) {
611
					if ( $first ) {
612
						$first = false;
613
					} else {
614
						$sql .= ',';
615
					}
616
					$sql .= '(' . $this->makeList( $row ) . ')';
617
				}
618
				$res = (bool)$this->query( $sql, $fname, $savepoint );
619
			} else {
620
				$res = true;