Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/88513
Change subject: Fix PHP CodeSniffer warnings and errors ...................................................................... Fix PHP CodeSniffer warnings and errors Also apply formatting convention. Change-Id: I792210d0d1c5f9089a71cecba95e17822f6da0e3 --- M maintenance/cleanupTable.inc M maintenance/cleanupTitles.php 2 files changed, 17 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/13/88513/1 diff --git a/maintenance/cleanupTable.inc b/maintenance/cleanupTable.inc index 410a55c..8fe7819 100644 --- a/maintenance/cleanupTable.inc +++ b/maintenance/cleanupTable.inc @@ -100,8 +100,8 @@ $dbr = wfGetDB( DB_SLAVE ); if ( array_diff( array_keys( $params ), - array( 'table', 'conds', 'index', 'callback' ) ) ) - { + array( 'table', 'conds', 'index', 'callback' ) ) + ) { throw new MWException( __METHOD__ . ': Missing parameter ' . implode( ', ', $params ) ); } @@ -110,7 +110,6 @@ $count = $dbr->estimateRowCount( $table, '*', '', __METHOD__ ); $this->init( $count, $table ); $this->output( "Processing $table...\n" ); - $index = (array)$params['index']; $indexConds = array(); diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php index 895254f..4a4365a 100644 --- a/maintenance/cleanupTitles.php +++ b/maintenance/cleanupTitles.php @@ -51,21 +51,24 @@ if ( !is_null( $title ) && $title->canExist() && $title->getNamespace() == $row->page_namespace - && $title->getDBkey() === $row->page_title ) - { - return $this->progress( 0 ); // all is fine + && $title->getDBkey() === $row->page_title + ) { + return $this->progress( 0 ); // all is fine } if ( $row->page_namespace == NS_FILE && $this->fileExists( $row->page_title ) ) { $this->output( "file $row->page_title needs cleanup, please run cleanupImages.php.\n" ); + return $this->progress( 0 ); } elseif ( is_null( $title ) ) { $this->output( "page $row->page_id ($display) is illegal.\n" ); $this->moveIllegalPage( $row ); + return $this->progress( 1 ); } else { $this->output( "page $row->page_id ($display) doesn't match self.\n" ); $this->moveInconsistentPage( $row, $title ); + return $this->progress( 1 ); } } @@ -75,6 +78,7 @@ // This is reasonable, since cleanupImages.php only iterates over the image table. $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'image', array( 'img_name' ), array( 'img_name' => $name ), __METHOD__ ); + return $row !== false; } @@ -104,9 +108,11 @@ $dest = $title->getDBkey(); if ( $this->dryrun ) { - $this->output( "DRY RUN: would rename $row->page_id ($row->page_namespace,'$row->page_title') to ($row->page_namespace,'$dest')\n" ); + $this->output( "DRY RUN: would rename $row->page_id ($row->page_namespace," . + "'$row->page_title') to ($row->page_namespace,'$dest')\n" ); } else { - $this->output( "renaming $row->page_id ($row->page_namespace,'$row->page_title') to ($row->page_namespace,'$dest')\n" ); + $this->output( "renaming $row->page_id ($row->page_namespace," . + "'$row->page_title') to ($row->page_namespace,'$dest')\n" ); $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'page', array( 'page_title' => $dest ), @@ -145,9 +151,11 @@ $dest = $title->getDBkey(); if ( $this->dryrun ) { - $this->output( "DRY RUN: would rename $row->page_id ($row->page_namespace,'$row->page_title') to ($ns,'$dest')\n" ); + $this->output( "DRY RUN: would rename $row->page_id ($row->page_namespace," . + "'$row->page_title') to ($ns,'$dest')\n" ); } else { - $this->output( "renaming $row->page_id ($row->page_namespace,'$row->page_title') to ($ns,'$dest')\n" ); + $this->output( "renaming $row->page_id ($row->page_namespace," . + "'$row->page_title') to ($ns,'$dest')\n" ); $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'page', array( -- To view, visit https://gerrit.wikimedia.org/r/88513 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I792210d0d1c5f9089a71cecba95e17822f6da0e3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits