Legoktm has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/360170 )
Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.9.0 ...................................................................... build: Updating mediawiki/mediawiki-codesniffer to 0.9.0 The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.ExtraParamComment * MediaWiki.Commenting.FunctionComment.MissingParamComment * MediaWiki.Commenting.FunctionComment.MissingParamName * MediaWiki.Commenting.FunctionComment.MissingParamTag * MediaWiki.Commenting.FunctionComment.MissingReturn * MediaWiki.Commenting.FunctionComment.ParamNameNoMatch * MediaWiki.Commenting.FunctionComment.WrongStyle * MediaWiki.FunctionComment.Missing.Protected * MediaWiki.FunctionComment.Missing.Public * MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName * MediaWiki.Usage.DbrQueryUsage.DbrQueryFound * MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage * MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment Change-Id: Ied62036d35464769bc1200e29c511eac11919c89 --- M FlaggedRevs.defines.php M FlaggedRevs.php M backend/FRPageConfig.php M backend/FRUserActivity.php M backend/FRUserCounters.php M backend/FlaggedRevs.class.php M backend/FlaggedRevs.hooks.php M business/PageStabilityForm.php M business/RevisionReviewForm.php M composer.json M frontend/FlaggablePageView.php M frontend/FlaggedRevsUI.hooks.php M frontend/RevisionReviewFormUI.php M frontend/specialpages/actions/RevisionReview_body.php M frontend/specialpages/actions/Stabilization_body.php M frontend/specialpages/reports/PendingChanges_body.php M frontend/specialpages/reports/ProblemChanges_body.php M maintenance/cachePendingRevs.php M maintenance/clearCachedText.php M maintenance/fixBug28348.php M maintenance/flagToSemiProtect.php M maintenance/populateRevTimestamp.php M maintenance/pruneRevData.php M maintenance/purgeReviewablePages.php M maintenance/reviewAllPages.php M maintenance/updateAutoPromote.php M maintenance/updateQueryCache.php M maintenance/updateStats.php M maintenance/updateTracking.php M phpcs.xml 30 files changed, 78 insertions(+), 127 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs refs/changes/70/360170/1 diff --git a/FlaggedRevs.defines.php b/FlaggedRevs.defines.php index 734845f..b56cd14 100644 --- a/FlaggedRevs.defines.php +++ b/FlaggedRevs.defines.php @@ -1,6 +1,5 @@ <?php -/* -* Defines global constants, some of which are used in LocalSettings.php +/** Defines global constants, some of which are used in LocalSettings.php */ # Query SELECT parameters... diff --git a/FlaggedRevs.php b/FlaggedRevs.php index 9295be3..f37423a 100644 --- a/FlaggedRevs.php +++ b/FlaggedRevs.php @@ -1,22 +1,5 @@ <?php -/* - (c) Aaron Schulz, Joerg Baach, 2007-2008 GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - http://www.gnu.org/copyleft/gpl.html -*/ +/* (c) Aaron Schulz, Joerg Baach, 2007-2008 GPL This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html*/ if ( !defined( 'MEDIAWIKI' ) ) { echo "FlaggedRevs extension\n"; @@ -36,7 +19,7 @@ ]; # Load global constants -require ( __DIR__ . '/FlaggedRevs.defines.php' ); +require __DIR__ . '/FlaggedRevs.defines.php'; # This will only distinguish "checked", "quality", and unreviewed # A small icon will show in the upper right hand corner @@ -147,22 +130,7 @@ # This can be used for newer, semi-trusted users to improve workflow. # It is done by granting some users the implicit 'autoreview' group. $wgFlaggedRevsAutoconfirm = false; -/* (example usage) -$wgFlaggedRevsAutoconfirm = [ - 'days' => 30, # days since registration - 'edits' => 50, # total edit count - 'excludeLastDays' => 2, # exclude the last X days of edits from below edit counts - 'benchmarks' => 7, # number of "spread out" edits - 'spacing' => 3, # number of days between these edits (the "spread") - // Either totalContentEdits reqs OR totalCheckedEdits requirements needed - 'totalContentEdits' => 150, # $wgContentNamespaces edits OR... - 'totalCheckedEdits' => 50, # ...Edits before the stable version of pages - 'uniqueContentPages' => 8, # $wgContentNamespaces unique pages edited - 'editComments' => 20, # how many edit comments used? - 'email' => false, # user must be emailconfirmed? - 'neverBlocked' => true, # Can users that were blocked be promoted? -]; -*/ +/* (example usage)$wgFlaggedRevsAutoconfirm = [ 'days' => 30, # days since registration 'edits' => 50, # total edit count 'excludeLastDays' => 2, # exclude the last X days of edits from below edit counts 'benchmarks' => 7, # number of "spread out" edits 'spacing' => 3, # number of days between these edits (the "spread") // Either totalContentEdits reqs OR totalCheckedEdits requirements needed 'totalContentEdits' => 150, # $wgContentNamespaces edits OR... 'totalCheckedEdits' => 50, # ...Edits before the stable version of pages 'uniqueContentPages' => 8, # $wgContentNamespaces unique pages edited 'editComments' => 20, # how many edit comments used? 'email' => false, # user must be emailconfirmed? 'neverBlocked' => true, # Can users that were blocked be promoted?];*/ # Defines extra rights for advanced reviewer class (Reviewers) $wgGroupPermissions['reviewer']['validate'] = true; @@ -597,7 +565,7 @@ * Note: avoid calls to FlaggedRevs class here for performance. * @return void */ -$wgExtensionFunctions[] = function() { +$wgExtensionFunctions[] = function () { # LocalSettings.php loaded, safe to load config FlaggedRevsSetup::setReady(); diff --git a/backend/FRPageConfig.php b/backend/FRPageConfig.php index 8e5adcb..23fc921 100644 --- a/backend/FRPageConfig.php +++ b/backend/FRPageConfig.php @@ -1,6 +1,5 @@ <?php -/* -* Page stability configuration functions +/** Page stability configuration functions */ class FRPageConfig { /** @@ -157,8 +156,7 @@ $defaultConfig = self::getDefaultVisibilitySettings(); # Check if the page is not protected at all... if ( $config['override'] == $defaultConfig['override'] - && $config['autoreview'] == '' ) - { + && $config['autoreview'] == '' ) { return "none"; // not protected } # All protection levels have 'override' on diff --git a/backend/FRUserActivity.php b/backend/FRUserActivity.php index ed6f2aa..e5adcc0 100644 --- a/backend/FRUserActivity.php +++ b/backend/FRUserActivity.php @@ -1,6 +1,5 @@ <?php -/* -* Class of utility functions for getting/tracking user activity +/** Class of utility functions for getting/tracking user activity */ class FRUserActivity { const PAGE_REVIEW_SEC = 1200; // 20*60 @@ -184,7 +183,7 @@ ObjectCache::getMainStashInstance()->merge( $key, - function( BagOStuff $stash, $key, $oldVal ) use ( $user, &$wasSet ) { + function ( BagOStuff $stash, $key, $oldVal ) use ( $user, &$wasSet ) { if ( count( $oldVal ) == 3 ) { // flag set list( $u, $ts, $cnt ) = $oldVal; if ( $u === $user->getName() ) { // by this user @@ -215,7 +214,7 @@ ObjectCache::getMainStashInstance()->merge( $key, - function( BagOStuff $stash, $key, $oldVal ) use ( $user, &$wasSet ) { + function ( BagOStuff $stash, $key, $oldVal ) use ( $user, &$wasSet ) { if ( count( $oldVal ) != 3 ) { return false; // flag not set } diff --git a/backend/FRUserCounters.php b/backend/FRUserCounters.php index 75d0c87..a6b7574 100644 --- a/backend/FRUserCounters.php +++ b/backend/FRUserCounters.php @@ -199,13 +199,11 @@ # Don't let this get bloated for no reason $maxUniquePages = 50; // some flexibility if ( is_array( $wgFlaggedRevsAutoconfirm ) && - $wgFlaggedRevsAutoconfirm['uniqueContentPages'] > $maxUniquePages ) - { + $wgFlaggedRevsAutoconfirm['uniqueContentPages'] > $maxUniquePages ) { $maxUniquePages = $wgFlaggedRevsAutoconfirm['uniqueContentPages']; } if ( is_array( $wgFlaggedRevsAutopromote ) && - $wgFlaggedRevsAutopromote['uniqueContentPages'] > $maxUniquePages ) - { + $wgFlaggedRevsAutopromote['uniqueContentPages'] > $maxUniquePages ) { $maxUniquePages = $wgFlaggedRevsAutopromote['uniqueContentPages']; } if ( count( $pages ) < $maxUniquePages // limit the size of this diff --git a/backend/FlaggedRevs.class.php b/backend/FlaggedRevs.class.php index feba22e..b5576df 100644 --- a/backend/FlaggedRevs.class.php +++ b/backend/FlaggedRevs.class.php @@ -499,8 +499,7 @@ } elseif ( !self::userCanSetTag( $user, $qal, $flags[$qal] ) ) { return false; // user cannot set proposed flag } elseif ( isset( $oldflags[$qal] ) - && !self::userCanSetTag( $user, $qal, $oldflags[$qal] ) ) - { + && !self::userCanSetTag( $user, $qal, $oldflags[$qal] ) ) { return false; // user cannot change old flag } } @@ -715,7 +714,7 @@ * Updates squid cache for a title. Defers till after main commit(). */ public static function purgeSquid( Title $title ) { - DeferredUpdates::addCallableUpdate( function() use ( $title ) { + DeferredUpdates::addCallableUpdate( function () use ( $title ) { $title->purgeSquid(); HTMLFileCache::clearFileCache( $title ); } ); @@ -773,7 +772,7 @@ * @return Object (val,time) tuple */ public static function makeMemcObj( $val ) { - $data = (object) []; + $data = (object)[]; $data->value = $val; $data->time = wfTimestampNow(); return $data; diff --git a/backend/FlaggedRevs.hooks.php b/backend/FlaggedRevs.hooks.php index 143b36c..0e82dcf 100644 --- a/backend/FlaggedRevs.hooks.php +++ b/backend/FlaggedRevs.hooks.php @@ -402,8 +402,7 @@ # Is the page manually checked off to be reviewed? if ( $editTimestamp && $wgRequest->getCheck( 'wpReviewEdit' ) - && $title->getUserPermissionsErrors( 'review', $user ) === [] ) - { + && $title->getUserPermissionsErrors( 'review', $user ) === [] ) { if ( self::editCheckReview( $fa, $rev, $user, $editTimestamp ) ) { return true; // reviewed...done! } @@ -707,8 +706,7 @@ // Note: $rev->getTitle() might be undefined (no rev id?) $badRev = Revision::newFromTitle( $article->getTitle(), $undid ); if ( $badRev && $badRev->getUser( Revision::RAW ) // by logged-in user - && $badRev->getUser( Revision::RAW ) != $rev->getUser( Revision::RAW ) ) // no self-reverts - { + && $badRev->getUser( Revision::RAW ) != $rev->getUser( Revision::RAW ) ) { FRUserCounters::incCount( $badRev->getUser( Revision::RAW ), 'revertedEdits' ); } } @@ -884,7 +882,7 @@ return true; } - DeferredUpdates::addCallableUpdate( function() use ( $user, $article, $summary ) { + DeferredUpdates::addCallableUpdate( function () use ( $user, $article, $summary ) { $p = FRUserCounters::getUserParams( $user->getId(), FR_FOR_UPDATE ); $changed = FRUserCounters::updateUserParams( $p, $article, $summary ); if ( $changed ) { diff --git a/business/PageStabilityForm.php b/business/PageStabilityForm.php index 1107809..f7f090a 100644 --- a/business/PageStabilityForm.php +++ b/business/PageStabilityForm.php @@ -378,8 +378,7 @@ $this->override = $this->override ? 1 : 0; // default version settings is 0 or 1 // Check autoreview restriction setting if ( $this->autoreview != '' // restriction other than 'none' - && !in_array( $this->autoreview, FlaggedRevs::getRestrictionLevels() ) ) - { + && !in_array( $this->autoreview, FlaggedRevs::getRestrictionLevels() ) ) { return 'stabilize_invalid_autoreview'; // invalid value } if ( !FlaggedRevs::userCanSetAutoreviewLevel( $this->user, $this->autoreview ) ) { diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php index 39655fa..d7250d3 100644 --- a/business/RevisionReviewForm.php +++ b/business/RevisionReviewForm.php @@ -381,8 +381,7 @@ # If this undid one edit by another logged-in user, update user tallies if ( $status === true && $newRev->getParentId() == $oldRev->getId() - && $newRev->getUser( Revision::RAW ) ) - { + && $newRev->getUser( Revision::RAW ) ) { if ( $newRev->getUser( Revision::RAW ) != $this->user->getId() ) { // no self-reverts FRUserCounters::incCount( $newRev->getUser( Revision::RAW ), 'revertedEdits' ); } @@ -439,8 +438,7 @@ $oldFrev->getFileSha1() == $fileData['sha1'] && $oldFrev->getFileTimestamp() == $fileData['timestamp'] && $oldFrev->getTemplateVersions( FR_MASTER ) == $tmpVersions && - $oldFrev->getFileVersions( FR_MASTER ) == $fileVersions ) - { + $oldFrev->getFileVersions( FR_MASTER ) == $fileVersions ) { return true; // don't record if the same } diff --git a/composer.json b/composer.json index 3e676f3..858a1ef 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.7.2", + "mediawiki/mediawiki-codesniffer": "0.9.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php index d8a079c..605e275 100644 --- a/frontend/FlaggablePageView.php +++ b/frontend/FlaggablePageView.php @@ -409,8 +409,7 @@ return; // stable version - index this } elseif ( !$request->getVal( 'stableid' ) && $this->out->getRevisionId() == $this->article->getStable() - && $this->article->stableVersionIsSynced() ) - { + && $this->article->stableVersionIsSynced() ) { return; // draft that is synced with the stable version - index this } $this->out->setRobotPolicy( 'noindex,nofollow' ); // don't index this version @@ -475,8 +474,7 @@ if ( $request->getVal( 'shownotice' ) && $this->article->getUserText( Revision::RAW ) == $reqUser->getName() && $this->article->revsArePending() - && !$reqUser->isAllowed( 'review' ) ) - { + && !$reqUser->isAllowed( 'review' ) ) { $revsSince = $this->article->getPendingRevCount(); $pending = $prot; if ( $this->showRatingIcon() ) { @@ -1256,8 +1254,7 @@ !isset( $actions['protect'] ) && !isset( $actions['unprotect'] ) && $reqUser->isAllowed( 'stablesettings' ) && - $title->exists() ) - { + $title->exists() ) { $stableTitle = SpecialPage::getTitleFor( 'Stabilization' ); // Add the tab $actions['default'] = [ @@ -1342,8 +1339,7 @@ $tabs['draft']['class'] .= ' selected'; // Are there *just* pending template/file changes. } elseif ( $this->article->onlyTemplatesOrFilesPending() - && $this->out->getRevisionId() == $this->article->getStable() ) - { + && $this->out->getRevisionId() == $this->article->getStable() ) { $tabs['draft']['class'] .= ' selected'; // Otherwise, fallback to regular tab behavior } else { @@ -1476,8 +1472,7 @@ # (b) list template/file changes if only includes are pending if ( $srev && $this->isDiffFromStable - && !$this->article->stableVersionIsSynced() ) // pending changes - { + && !$this->article->stableVersionIsSynced() ) { $changeText = ''; # Page not synced only due to includes? if ( !$this->article->revsArePending() ) { @@ -1507,8 +1502,7 @@ // Reviewer just edited... if ( $request->getInt( 'shownotice' ) && $newRev->isCurrent() - && $newRev->getUserText( Revision::RAW ) == $reqUser->getName() ) - { + && $newRev->getUserText( Revision::RAW ) == $reqUser->getName() ) { $title = $this->article->getTitle(); // convenience // @TODO: make diff class cache this $n = $title->countRevisionsBetween( $oldRev, $newRev ); diff --git a/frontend/FlaggedRevsUI.hooks.php b/frontend/FlaggedRevsUI.hooks.php index a2387cf..82f2ca0 100644 --- a/frontend/FlaggedRevsUI.hooks.php +++ b/frontend/FlaggedRevsUI.hooks.php @@ -267,8 +267,7 @@ public static function onSkinAfterContent( &$data ) { global $wgOut; if ( $wgOut->isArticleRelated() - && FlaggablePageView::globalArticleInstance() != null ) - { + && FlaggablePageView::globalArticleInstance() != null ) { $view = FlaggablePageView::singleton(); // Only use this hook if we want to append the form. // We *prepend* the form for diffs, so skip that case here. @@ -405,7 +404,6 @@ public static function modifyChangesListSpecialPageQuery( $name, &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) { - self::addMetadataQueryJoins( $tables, $join_conds, $fields ); } @@ -598,8 +596,7 @@ } elseif ( isset( $row->fr_quality ) ) { $classes[] = FlaggedRevsXML::getQualityColor( $row->fr_quality ); } elseif ( isset( $row->fp_pending_since ) - && $row->rev_timestamp >= $row->fp_pending_since ) // bug 15515 - { + && $row->rev_timestamp >= $row->fp_pending_since ) { $classes[] = 'flaggedrevs-pending'; } elseif ( !isset( $row->fp_stable ) ) { $classes[] = 'flaggedrevs-unreviewed'; @@ -613,8 +610,7 @@ $title = $rc->getTitle(); // convenience if ( !FlaggedRevs::inReviewNamespace( $title ) || empty( $rc->mAttribs['rc_this_oldid'] ) // rev, not log - || !array_key_exists( 'fp_stable', $rc->mAttribs ) ) - { + || !array_key_exists( 'fp_stable', $rc->mAttribs ) ) { return true; // confirm that page is in reviewable namespace } $rlink = $css = ''; @@ -628,8 +624,7 @@ } // page is reviewed and has pending edits (use timestamps; bug 15515) } elseif ( isset( $rc->mAttribs['fp_pending_since'] ) && - $rc->mAttribs['rc_timestamp'] >= $rc->mAttribs['fp_pending_since'] ) - { + $rc->mAttribs['rc_timestamp'] >= $rc->mAttribs['fp_pending_since'] ) { $rlink = Linker::link( $title, wfMessage( 'revreview-reviewlink' )->escaped(), diff --git a/frontend/RevisionReviewFormUI.php b/frontend/RevisionReviewFormUI.php index 3cad3f5..5b275c7 100644 --- a/frontend/RevisionReviewFormUI.php +++ b/frontend/RevisionReviewFormUI.php @@ -115,8 +115,7 @@ # Disable form for unprivileged users $disabled = []; if ( !$article->getTitle()->quickUserCan( 'review' ) || - !FlaggedRevs::userCanSetFlags( $this->user, $flags ) ) - { + !FlaggedRevs::userCanSetFlags( $this->user, $flags ) ) { $disabled = [ 'disabled' => 'disabled' ]; } @@ -341,8 +340,7 @@ # Build up all levels available to user foreach ( FlaggedRevs::getDimensions() as $tag => $levels ) { if ( isset( $selected[$tag] ) && - !FlaggedRevs::userCanSetTag( $user, $tag, $selected[$tag] ) ) - { + !FlaggedRevs::userCanSetTag( $user, $tag, $selected[$tag] ) ) { return [ false, false ]; // form will have to be disabled } $labels[$tag] = []; // applicable tag levels diff --git a/frontend/specialpages/actions/RevisionReview_body.php b/frontend/specialpages/actions/RevisionReview_body.php index 38d7bbd..974a95b 100644 --- a/frontend/specialpages/actions/RevisionReview_body.php +++ b/frontend/specialpages/actions/RevisionReview_body.php @@ -213,8 +213,7 @@ wfMessage( 'revreview-submission-invalid' )->parse(); } list( $par, $val ) = $set; - switch ( $par ) - { + switch ( $par ) { case "target": $title = Title::newFromURL( $val ); break; diff --git a/frontend/specialpages/actions/Stabilization_body.php b/frontend/specialpages/actions/Stabilization_body.php index 195b12b..50bf49d 100644 --- a/frontend/specialpages/actions/Stabilization_body.php +++ b/frontend/specialpages/actions/Stabilization_body.php @@ -288,8 +288,7 @@ # Don't let them choose levels they can't set, # but *show* them all when the form is disabled. if ( $this->form->isAllowed() - && !FlaggedRevs::userCanSetAutoreviewLevel( $this->getUser(), $key ) ) - { + && !FlaggedRevs::userCanSetAutoreviewLevel( $this->getUser(), $key ) ) { continue; } $allowedLevels[] = $key; diff --git a/frontend/specialpages/reports/PendingChanges_body.php b/frontend/specialpages/reports/PendingChanges_body.php index 83729f9..075df81 100644 --- a/frontend/specialpages/reports/PendingChanges_body.php +++ b/frontend/specialpages/reports/PendingChanges_body.php @@ -310,7 +310,6 @@ function __construct( $form, $namespace, $level = - 1, $category = '', $size = null, $watched = false, $stable = false ) { - $this->mForm = $form; # Must be a content page... $vnamespaces = FlaggedRevs::getReviewNamespaces(); diff --git a/frontend/specialpages/reports/ProblemChanges_body.php b/frontend/specialpages/reports/ProblemChanges_body.php index 18d0d1a..d832c63 100644 --- a/frontend/specialpages/reports/ProblemChanges_body.php +++ b/frontend/specialpages/reports/ProblemChanges_body.php @@ -301,7 +301,6 @@ const PAGE_LIMIT = 100; // Don't get too expensive function __construct( $form, $level = - 1, $category = '', $tag = '' ) { - $this->mForm = $form; # Must be a content page... $this->namespace = FlaggedRevs::getReviewNamespaces(); diff --git a/maintenance/cachePendingRevs.php b/maintenance/cachePendingRevs.php index 76b1998..67b89de 100644 --- a/maintenance/cachePendingRevs.php +++ b/maintenance/cachePendingRevs.php @@ -11,7 +11,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class CachePendingRevs extends Maintenance { @@ -58,4 +58,4 @@ } $maintClass = "CachePendingRevs"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/clearCachedText.php b/maintenance/clearCachedText.php index 4d3862b..1b17cc2 100644 --- a/maintenance/clearCachedText.php +++ b/maintenance/clearCachedText.php @@ -9,7 +9,7 @@ $IP = __DIR__ . '/../../..'; } $optionsWithArgs = [ 'backup' ]; -require ( "$IP/maintenance/commandLine.inc" ); +require "$IP/maintenance/commandLine.inc"; $pageId = 0; $revId = 0; @@ -62,4 +62,3 @@ wfWaitForSlaves( 5 ); echo "$pageId / $maxPage\n"; } - diff --git a/maintenance/fixBug28348.php b/maintenance/fixBug28348.php index 2de8a75..6a06f81 100644 --- a/maintenance/fixBug28348.php +++ b/maintenance/fixBug28348.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class FixBug28348 extends Maintenance { @@ -98,4 +98,4 @@ } $maintClass = "FixBug28348"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/flagToSemiProtect.php b/maintenance/flagToSemiProtect.php index c8591d3..7581f7a 100644 --- a/maintenance/flagToSemiProtect.php +++ b/maintenance/flagToSemiProtect.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class FlagProtectToSemiProtect extends Maintenance { @@ -135,4 +135,4 @@ } $maintClass = "FlagProtectToSemiProtect"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/populateRevTimestamp.php b/maintenance/populateRevTimestamp.php index 0930ad1..c1cda9c 100644 --- a/maintenance/populateRevTimestamp.php +++ b/maintenance/populateRevTimestamp.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class PopulateFRRevTimestamp extends Maintenance { @@ -98,4 +98,4 @@ } $maintClass = "PopulateFRRevTimestamp"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/pruneRevData.php b/maintenance/pruneRevData.php index 9f2b954..3eb5005 100644 --- a/maintenance/pruneRevData.php +++ b/maintenance/pruneRevData.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class PruneFRIncludeData extends Maintenance { @@ -144,4 +144,4 @@ } $maintClass = "PruneFRIncludeData"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/purgeReviewablePages.php b/maintenance/purgeReviewablePages.php index 81e0d47..c0bbe0b 100644 --- a/maintenance/purgeReviewablePages.php +++ b/maintenance/purgeReviewablePages.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class PurgeReviewablePages extends Maintenance { @@ -127,4 +127,4 @@ } $maintClass = "PurgeReviewablePages"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/reviewAllPages.php b/maintenance/reviewAllPages.php index f613193..903ff13 100644 --- a/maintenance/reviewAllPages.php +++ b/maintenance/reviewAllPages.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class ReviewAllPages extends Maintenance { @@ -93,4 +93,4 @@ } $maintClass = "ReviewAllPages"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/updateAutoPromote.php b/maintenance/updateAutoPromote.php index 007c067..dfc0ad3 100644 --- a/maintenance/updateAutoPromote.php +++ b/maintenance/updateAutoPromote.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class UpdateFRAutoPromote extends Maintenance { @@ -26,7 +26,7 @@ $dbw = wfGetDB( DB_MASTER ); $start = $dbr->selectField( 'user', 'MIN(user_id)', false, __METHOD__ ); $end = $dbr->selectField( 'user', 'MAX(user_id)', false, __METHOD__ ); - if ( is_null( $start ) || is_null( $end ) ){ + if ( is_null( $start ) || is_null( $end ) ) { $this->output( "...user table seems to be empty.\n" ); return; } @@ -89,4 +89,4 @@ } $maintClass = "UpdateFRAutoPromote"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/updateQueryCache.php b/maintenance/updateQueryCache.php index 62098d4..6e3e6d9 100644 --- a/maintenance/updateQueryCache.php +++ b/maintenance/updateQueryCache.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class UpdateFlaggedRevsQueryCache extends Maintenance { @@ -30,4 +30,4 @@ } $maintClass = "UpdateFlaggedRevsQueryCache"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/updateStats.php b/maintenance/updateStats.php index 983332f..4c2591e 100644 --- a/maintenance/updateStats.php +++ b/maintenance/updateStats.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class UpdateFlaggedRevsStats extends Maintenance { @@ -30,4 +30,4 @@ } $maintClass = "UpdateFlaggedRevsStats"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/updateTracking.php b/maintenance/updateTracking.php index e76333b..37b33ef 100644 --- a/maintenance/updateTracking.php +++ b/maintenance/updateTracking.php @@ -8,7 +8,7 @@ $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +require_once "$IP/maintenance/Maintenance.php"; class UpdateFRTracking extends Maintenance { @@ -114,8 +114,7 @@ if ( $quality != $row->fr_quality || $file != $row->fr_img_name || $fileSha1 != $row->fr_img_sha1 - || $fileTime != $row->fr_img_timestamp ) - { + || $fileTime != $row->fr_img_timestamp ) { # Update the row... $db->update( 'flaggedrevs', [ @@ -267,4 +266,4 @@ } $maintClass = "UpdateFRTracking"; -require_once ( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/phpcs.xml b/phpcs.xml index 1a0d461..ec7bdf0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,9 +1,23 @@ <?xml version="1.0"?> <ruleset> - <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/> + <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> + <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> + <exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" /> + <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> + <exclude name="MediaWiki.FunctionComment.Missing.Protected" /> + <exclude name="MediaWiki.FunctionComment.Missing.Public" /> + <exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" /> + <exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" /> + <exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" /> + <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" /> + </rule> <file>.</file> - <arg name="extensions" value="php,php5,inc"/> - <arg name="encoding" value="utf8"/> + <arg name="extensions" value="php,php5,inc" /> + <arg name="encoding" value="utf8" /> <exclude-pattern>vendor</exclude-pattern> <rule ref="MediaWiki.NamingConventions.ValidGlobalName"> <properties> -- To view, visit https://gerrit.wikimedia.org/r/360170 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied62036d35464769bc1200e29c511eac11919c89 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FlaggedRevs Gerrit-Branch: master Gerrit-Owner: Legoktm <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
