From 7724e285fded905b8d6c8c7ffd53fc8b8a9a662c Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 1 Nov 2015 21:03:18 +0100 Subject: [PATCH] phpcs: Fix some "Single space expected before elseif" Found by new version of mediawiki/codesniffer https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/1939/consoleFull Change-Id: I465bf0d1c89603b3dfc9867be3c0b1190829312d --- includes/search/SearchOracle.php | 3 +-- includes/search/SearchPostgres.php | 18 +++++++----------- maintenance/backupTextPass.inc | 6 ++---- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/includes/search/SearchOracle.php b/includes/search/SearchOracle.php index 58211484ab..6dad3424b1 100644 --- a/includes/search/SearchOracle.php +++ b/includes/search/SearchOracle.php @@ -191,8 +191,7 @@ class SearchOracle extends SearchDatabase { foreach ( $temp_terms as $t ) { $searchon .= ( $terms[1] == '-' ? ' ~' : ' & ' ) . $this->escapeTerm( $t ); } - } - else { + } else { $searchon .= ( $terms[1] == '-' ? ' ~' : ' & ' ) . $this->escapeTerm( $terms[2] ); } if ( !empty( $terms[3] ) ) { diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 60c42496cd..649ef4f70f 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -84,14 +84,11 @@ class SearchPostgres extends SearchDatabase { } if ( strtolower( $terms[2] ) === 'and' ) { $searchstring .= ' & '; - } - elseif ( strtolower( $terms[2] ) === 'or' || $terms[2] === '|' ) { + } elseif ( strtolower( $terms[2] ) === 'or' || $terms[2] === '|' ) { $searchstring .= ' | '; - } - elseif ( strtolower( $terms[2] ) === 'not' ) { + } elseif ( strtolower( $terms[2] ) === 'not' ) { $searchstring .= ' & !'; - } - else { + } else { $searchstring .= " & $terms[2]"; } } @@ -147,8 +144,7 @@ class SearchPostgres extends SearchDatabase { $query = "SELECT page_id, page_namespace, page_title, 0 AS score " . "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " . "AND r.rev_text_id = c.old_id AND 1=0"; - } - else { + } else { $m = array(); if ( preg_match_all( "/'([^']+)'/", $top, $m, PREG_SET_ORDER ) ) { foreach ( $m as $terms ) { @@ -157,9 +153,9 @@ class SearchPostgres extends SearchDatabase { } $query = "SELECT page_id, page_namespace, page_title, " . - "ts_rank($fulltext, to_tsquery($searchstring), 5) AS score " . - "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " . - "AND r.rev_text_id = c.old_id AND $fulltext @@ to_tsquery($searchstring)"; + "ts_rank($fulltext, to_tsquery($searchstring), 5) AS score " . + "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " . + "AND r.rev_text_id = c.old_id AND $fulltext @@ to_tsquery($searchstring)"; } # # Namespaces - defaults to 0 diff --git a/maintenance/backupTextPass.inc b/maintenance/backupTextPass.inc index 0ed584c480..0562333225 100644 --- a/maintenance/backupTextPass.inc +++ b/maintenance/backupTextPass.inc @@ -899,11 +899,9 @@ class TextPassDumper extends BackupDumper { } elseif ( $this->state == "page" ) { $this->thisPage .= $data; } - } - elseif ( $this->lastName == "model" ) { + } elseif ( $this->lastName == "model" ) { $this->thisRevModel .= $data; - } - elseif ( $this->lastName == "format" ) { + } elseif ( $this->lastName == "format" ) { $this->thisRevFormat .= $data; } -- 2.20.1