Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364118 )

Change subject: Break long lines
......................................................................

Break long lines

Change-Id: Ie683924e7ebbae91bcc0cbd7d80621ec1b3aacc7
---
M FlaggedRevs.php
M api/actions/ApiReview.php
M api/actions/ApiStabilize.php
M api/reports/ApiQueryConfiguredPages.php
M api/reports/ApiQueryFlagged.php
M api/reports/ApiQueryOldreviewedpages.php
M api/reports/ApiQueryReviewedpages.php
M backend/FlaggedRevsLog.php
M frontend/FlaggablePageView.php
M frontend/FlaggedRevsXML.php
M frontend/RevisionReviewFormUI.php
M maintenance/fixBug28348.php
M maintenance/purgeReviewablePages.php
M phpcs.xml
M scribunto/FlaggedRevs.library.php
15 files changed, 174 insertions(+), 79 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs 
refs/changes/18/364118/1

diff --git a/FlaggedRevs.php b/FlaggedRevs.php
index f5182ea..c74bb3f 100644
--- a/FlaggedRevs.php
+++ b/FlaggedRevs.php
@@ -272,8 +272,10 @@
 # UI setup, forms, and HTML elements
 $wgAutoloadClasses['FlaggedRevsUISetup'] = 
"$frontendDir/FlaggedRevsUI.setup.php";
 $wgAutoloadClasses['FlaggablePageView'] = "$frontendDir/FlaggablePageView.php";
-$wgAutoloadClasses['FlaggedRevsReviewLogFormatter'] = 
"$frontendDir/FlaggedRevsReviewLogFormatter.php";
-$wgAutoloadClasses['FlaggedRevsStableLogFormatter'] = 
"$frontendDir/FlaggedRevsStableLogFormatter.php";
+$wgAutoloadClasses['FlaggedRevsReviewLogFormatter'] =
+       "$frontendDir/FlaggedRevsReviewLogFormatter.php";
+$wgAutoloadClasses['FlaggedRevsStableLogFormatter'] =
+       "$frontendDir/FlaggedRevsStableLogFormatter.php";
 $wgAutoloadClasses['FlaggedRevsXML'] = "$frontendDir/FlaggedRevsXML.php";
 $wgAutoloadClasses['RevisionReviewFormUI'] = 
"$frontendDir/RevisionReviewFormUI.php";
 $wgAutoloadClasses['RejectConfirmationFormUI'] = 
"$frontendDir/RejectConfirmationFormUI.php";
@@ -389,7 +391,9 @@
                'revreview-sadv-reviewing-p', 'revreview-sadv-reviewing-c',
                'revreview-adv-start-link', 'revreview-adv-stop-link'
        ],
-       'dependencies'  => [ 'mediawiki.util', 'mediawiki.notify', 
'mediawiki.user', 'mediawiki.jqueryMsg' ],
+       'dependencies'  => [
+               'mediawiki.util', 'mediawiki.notify', 'mediawiki.user', 
'mediawiki.jqueryMsg'
+       ],
        'localBasePath' => $localModulePath,
        'remoteExtPath' => $remoteModulePath,
 ];
@@ -446,12 +450,16 @@
 # Various actions are used for log filtering ...
 $wgLogActionsHandlers['review/approve']  = 'FlaggedRevsReviewLogFormatter'; // 
checked (again)
 $wgLogActionsHandlers['review/approve2']  = 'FlaggedRevsReviewLogFormatter'; 
// quality (again)
-$wgLogActionsHandlers['review/approve-i']  = 'FlaggedRevsReviewLogFormatter'; 
// checked (first time)
-$wgLogActionsHandlers['review/approve2-i']  = 'FlaggedRevsReviewLogFormatter'; 
// quality (first time)
+$wgLogActionsHandlers['review/approve-i']  =
+       'FlaggedRevsReviewLogFormatter'; // checked (first time)
+$wgLogActionsHandlers['review/approve2-i']  =
+       'FlaggedRevsReviewLogFormatter'; // quality (first time)
 $wgLogActionsHandlers['review/approve-a']  = 'FlaggedRevsReviewLogFormatter'; 
// checked (auto)
 $wgLogActionsHandlers['review/approve2-a']  = 'FlaggedRevsReviewLogFormatter'; 
// quality (auto)
-$wgLogActionsHandlers['review/approve-ia']  = 'FlaggedRevsReviewLogFormatter'; 
// checked (initial & auto)
-$wgLogActionsHandlers['review/approve2-ia']  = 
'FlaggedRevsReviewLogFormatter'; // quality (initial & auto)
+$wgLogActionsHandlers['review/approve-ia']  =
+       'FlaggedRevsReviewLogFormatter'; // checked (initial & auto)
+$wgLogActionsHandlers['review/approve2-ia']  =
+       'FlaggedRevsReviewLogFormatter'; // quality (initial & auto)
 $wgLogActionsHandlers['review/unapprove'] = 'FlaggedRevsReviewLogFormatter'; 
// was checked
 $wgLogActionsHandlers['review/unapprove2'] = 'FlaggedRevsReviewLogFormatter'; 
// was quality
 
@@ -554,7 +562,8 @@
 if ( version_compare( $wgVersion, '1.29', '<' ) ) {
        $wgHooks['EditPageBeforeEditChecks'][] = 
'FlaggedRevsUIHooks::onEditPageBeforeEditChecks';
 } else {
-       $wgHooks['EditPageGetCheckboxesDefinition'][] = 
'FlaggedRevsUIHooks::onEditPageGetCheckboxesDefinition';
+       $wgHooks['EditPageGetCheckboxesDefinition'][] =
+               'FlaggedRevsUIHooks::onEditPageGetCheckboxesDefinition';
 }
 $wgHooks['EditPage::showEditForm:fields'][] = 
'FlaggedRevsUIHooks::addRevisionIDField';
 # Add draft link to section edit error
diff --git a/api/actions/ApiReview.php b/api/actions/ApiReview.php
index cb11030..8a80692 100644
--- a/api/actions/ApiReview.php
+++ b/api/actions/ApiReview.php
@@ -132,8 +132,10 @@
                                if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
                                        $this->dieWithError( 
'apierror-flaggedrevs-cantreview', 'permissiondenied' );
                                } else {
-                                       $this->dieUsage( "You don't have the 
necessary rights to set the specified flags.",
-                                               'permissiondenied' );
+                                       $this->dieUsage(
+                                               "You don't have the necessary 
rights to set the specified flags.",
+                                               'permissiondenied'
+                                       );
                                }
                        } elseif ( $status === 'review_too_low' ) {
                                if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
@@ -146,8 +148,10 @@
                                if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
                                        $this->dieWithError( 
'apierror-flaggedrevs-cantreview', 'permissiondenied' );
                                } else {
-                                       $this->dieUsage( "You don't have the 
necessary rights to set the specified flags.",
-                                               'permissiondenied' );
+                                       $this->dieUsage(
+                                               "You don't have the necessary 
rights to set the specified flags.",
+                                               'permissiondenied'
+                                       );
                                }
                        } elseif ( $status === 'review_bad_tags' ) {
                                if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
@@ -211,7 +215,8 @@
                        'unapprove' => false
                ];
                if ( !FlaggedRevs::binaryFlagging() ) {
-                       /** @todo Once support for MediaWiki < 1.25 is dropped, 
just use ApiBase::PARAM_HELP_MSG directly */
+                       /** @todo Once support for MediaWiki < 1.25 is dropped,
+                        * just use ApiBase::PARAM_HELP_MSG directly */
                        $key = constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '';
                        foreach ( FlaggedRevs::getDimensions() as $flagname => 
$levels ) {
                                $pars['flag_' . $flagname] = [
diff --git a/api/actions/ApiStabilize.php b/api/actions/ApiStabilize.php
index 0f295ba..136d8cc 100644
--- a/api/actions/ApiStabilize.php
+++ b/api/actions/ApiStabilize.php
@@ -36,7 +36,9 @@
                $this->title = Title::newFromText( $params['title'] );
                if ( $this->title == null ) {
                        if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-                               $this->dieWithError( [ 'apierror-invelidtitle', 
wfEscapeWikiText( $params['title'] ) ] );
+                               $this->dieWithError(
+                                       [ 'apierror-invelidtitle', 
wfEscapeWikiText( $params['title'] ) ]
+                               );
                        } else {
                                $this->dieUsage( "Invalid title given.", 
"invalidtitle" );
                        }
@@ -145,8 +147,10 @@
                        ],
                        'expiry'      => [
                                ApiBase::PARAM_DFLT => 'infinite',
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
-                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'apihelp-stabilize-param-expiry-general',
+                               /** @todo Once support for MediaWiki < 1.25 is 
dropped,
+                                * just use ApiBase::PARAM_HELP_MSG directly */
+                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' =>
+                                       
'apihelp-stabilize-param-expiry-general',
                        ],
                        'reason'      => '',
                        'review'      => false,
@@ -156,8 +160,10 @@
                        ],
                        'title'       => [
                                ApiBase::PARAM_REQUIRED => true,
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
-                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'apihelp-stabilize-param-title-general',
+                               /** @todo Once support for MediaWiki < 1.25 is 
dropped,
+                                * just use ApiBase::PARAM_HELP_MSG directly */
+                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' =>
+                                       'apihelp-stabilize-param-title-general',
                        ],
                ];
                return $pars;
@@ -275,8 +281,10 @@
                        ],
                        'expiry'      => [
                                ApiBase::PARAM_DFLT => 'infinite',
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
-                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'apihelp-stabilize-param-expiry-protect',
+                               /** @todo Once support for MediaWiki < 1.25 is 
dropped,
+                                * just use ApiBase::PARAM_HELP_MSG directly */
+                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' =>
+                                       
'apihelp-stabilize-param-expiry-protect',
                        ],
                        'reason'    => '',
                        'watch'     => null,
@@ -285,8 +293,10 @@
                        ],
                        'title'       => [
                                ApiBase::PARAM_REQUIRED => true,
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
-                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'apihelp-stabilize-param-title-protect',
+                               /** @todo Once support for MediaWiki < 1.25 is 
dropped,
+                                * just use ApiBase::PARAM_HELP_MSG directly */
+                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' =>
+                                       'apihelp-stabilize-param-title-protect',
                        ],
                ];
        }
diff --git a/api/reports/ApiQueryConfiguredPages.php 
b/api/reports/ApiQueryConfiguredPages.php
index 9a98857..d02fa59 100644
--- a/api/reports/ApiQueryConfiguredPages.php
+++ b/api/reports/ApiQueryConfiguredPages.php
@@ -145,7 +145,8 @@
                        'dir' => [
                                ApiBase::PARAM_DFLT     => 'newer',
                                ApiBase::PARAM_TYPE     => [ 'newer', 'older' ],
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
+                               /** @todo Once support for MediaWiki < 1.25 is 
dropped,
+                                * just use ApiBase::PARAM_HELP_MSG directly */
                                constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'api-help-param-direction',
                        ],
                        'namespace' => [
diff --git a/api/reports/ApiQueryFlagged.php b/api/reports/ApiQueryFlagged.php
index 091bbed..df64aa3 100644
--- a/api/reports/ApiQueryFlagged.php
+++ b/api/reports/ApiQueryFlagged.php
@@ -62,8 +62,16 @@
                $this->addFields( [ 'fpc_page_id', 'fpc_level', 'fpc_expiry' ] 
);
                $this->addWhereFld( 'fpc_page_id', $pageids );
                foreach ( $this->select( __METHOD__ ) as $row ) {
-                       $result->addValue( [ 'query', 'pages', 
$row->fpc_page_id, 'flagged' ], 'protection_level', $row->fpc_level );
-                       $result->addValue( [ 'query', 'pages', 
$row->fpc_page_id, 'flagged' ], 'protection_expiry', $wgContLang->formatExpiry( 
$row->fpc_expiry, TS_ISO_8601 ) );
+                       $result->addValue(
+                               [ 'query', 'pages', $row->fpc_page_id, 
'flagged' ],
+                               'protection_level',
+                               $row->fpc_level
+                       );
+                       $result->addValue(
+                               [ 'query', 'pages', $row->fpc_page_id, 
'flagged' ],
+                               'protection_expiry',
+                               $wgContLang->formatExpiry( $row->fpc_expiry, 
TS_ISO_8601 )
+                       );
                }
 
                return true;
diff --git a/api/reports/ApiQueryOldreviewedpages.php 
b/api/reports/ApiQueryOldreviewedpages.php
index 9056a2e..ef8ffbe 100644
--- a/api/reports/ApiQueryOldreviewedpages.php
+++ b/api/reports/ApiQueryOldreviewedpages.php
@@ -173,7 +173,8 @@
                        'dir' => [
                                ApiBase::PARAM_DFLT => 'newer',
                                ApiBase::PARAM_TYPE => [ 'newer', 'older' ],
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
+                               /** @todo Once support for MediaWiki < 1.25 is 
dropped,
+                                * just use ApiBase::PARAM_HELP_MSG directly */
                                constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'api-help-param-direction',
                        ],
                        'maxsize' => [
diff --git a/api/reports/ApiQueryReviewedpages.php 
b/api/reports/ApiQueryReviewedpages.php
index 27d20dd..8ee191c 100644
--- a/api/reports/ApiQueryReviewedpages.php
+++ b/api/reports/ApiQueryReviewedpages.php
@@ -135,7 +135,8 @@
                                        'newer',
                                        'older'
                                ],
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
+                               /** @todo Once support for MediaWiki < 1.25 is 
dropped,
+                                * just use ApiBase::PARAM_HELP_MSG directly */
                                constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'api-help-param-direction',
                        ],
                        'namespace' => [
diff --git a/backend/FlaggedRevsLog.php b/backend/FlaggedRevsLog.php
index 525bd9c..3cb00a5 100644
--- a/backend/FlaggedRevsLog.php
+++ b/backend/FlaggedRevsLog.php
@@ -23,9 +23,10 @@
                if ( !FlaggedRevs::binaryFlagging() ) {
                        // Give grep a chance to find the usages:
                        // revreview-accuracy, revreview-depth, revreview-style,
-                       // revreview-accuracy-0, revreview-accuracy-1, 
revreview-accuracy-2, revreview-accuracy-3, revreview-accuracy-4,
-                       // revreview-depth-0, revreview-depth-1, 
revreview-depth-2, revreview-depth-3, revreview-depth-4,
-                       // revreview-style-0, revreview-style-1, 
revreview-style-2, revreview-style-3, revreview-style-4
+                       // revreview-accuracy-0, revreview-accuracy-1, 
revreview-accuracy-2,
+                       // revreview-accuracy-3, revreview-accuracy-4, 
revreview-depth-0, revreview-depth-1,
+                       // revreview-depth-2, revreview-depth-3, 
revreview-depth-4, revreview-style-0,
+                       // revreview-style-1, revreview-style-2, 
revreview-style-3, revreview-style-4
                        foreach ( $dims as $quality => $level ) {
                                $ratings[] = wfMessage( "revreview-$quality" 
)->inContentLanguage()->text() .
                                        wfMessage( 'colon-separator' 
)->inContentLanguage()->text() .
@@ -113,7 +114,9 @@
         * @param string $reason
         * @param User $user performing the action
         */
-       public static function updateStabilityLogOnMove( Title $newTitle, Title 
$oldTitle, $reason, $user ) {
+       public static function updateStabilityLogOnMove(
+               Title $newTitle, Title $oldTitle, $reason, $user
+       ) {
                $logEntry = new ManualLogEntry( 'stable', 'move_stable' );
                $logEntry->setPerformer( $user );
                $logEntry->setTarget( $newTitle );
diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php
index c048bba..8ee8bdf 100644
--- a/frontend/FlaggablePageView.php
+++ b/frontend/FlaggablePageView.php
@@ -482,7 +482,8 @@
                        if ( $this->showRatingIcon() ) {
                                $pending .= FlaggedRevsXML::draftStatusIcon();
                        }
-                       $pending .= $this->msg( 'revreview-edited', 
$srev->getRevId() )->numParams( $revsSince )->parse();
+                       $pending .= $this->msg( 'revreview-edited', 
$srev->getRevId() )
+                               ->numParams( $revsSince )->parse();
                        $anchor = $request->getVal( 'fromsection' );
                        if ( $anchor != null ) {
                                // Hack: reverse some of the 
Sanitizer::escapeId() encoding
@@ -490,7 +491,8 @@
                                        [ ':' , '.' ], [ '%3A', '%' ], $anchor
                                ) );
                                $section = str_replace( '_', ' ', $section ); 
// prettify
-                               $pending .= $this->msg( 
'revreview-edited-section', $anchor, $section )->parseAsBlock();
+                               $pending .= $this->msg( 
'revreview-edited-section', $anchor, $section )
+                                       ->parseAsBlock();
                        }
                        # Notice should always use subtitle
                        $this->reviewNotice = "<div id='mw-fr-reviewnotice' " .
@@ -508,12 +510,14 @@
                                        $msg = $quality ?
                                                'revreview-quick-quality-same' :
                                                'revreview-quick-basic-same';
-                                       $msgHTML = $this->msg( $msg, 
$srev->getRevId() )->numParams( $revsSince )->parse();
+                                       $msgHTML = $this->msg( $msg, 
$srev->getRevId() )
+                                               ->numParams( $revsSince 
)->parse();
                                } else {
                                        $msg = $quality ?
                                                'revreview-quick-see-quality' :
                                                'revreview-quick-see-basic';
-                                       $msgHTML = $this->msg( $msg, 
$srev->getRevId() )->numParams( $revsSince )->parse();
+                                       $msgHTML = $this->msg( $msg, 
$srev->getRevId() )
+                                               ->numParams( $revsSince 
)->parse();
                                }
                                $icon = '';
                                # For protection based configs, show lock only 
if it's not redundant.
@@ -538,7 +542,8 @@
                                        // Messages: 
revreview-newest-quality-i, revreview-newest-basic-i
                                        $msg .= ( $revsSince == 0 ) ? '-i' : '';
                                }
-                               $msgHTML = $this->msg( $msg, $srev->getRevId(), 
$time )->numParams( $revsSince )->parse();
+                               $msgHTML = $this->msg( $msg, $srev->getRevId(), 
$time )
+                                       ->numParams( $revsSince )->parse();
                                $icon = $synced ?
                                        FlaggedRevsXML::stableStatusIcon( 
$quality ) :
                                        FlaggedRevsXML::draftStatusIcon();
@@ -582,7 +587,8 @@
                                        $msg = $quality ?
                                                'revreview-quick-quality-old' :
                                                'revreview-quick-basic-old';
-                                       $msgHTML = $this->msg( $msg, 
$frev->getRevId() )->numParams( $revsSince )->parse();
+                                       $msgHTML = $this->msg( $msg, 
$frev->getRevId() )
+                                               ->numParams( $revsSince 
)->parse();
                                }
                                $msgHTML = $prot . $icon . $msgHTML;
                                $tag = FlaggedRevsXML::prettyRatingBox( $frev, 
$msgHTML,
@@ -653,7 +659,8 @@
                                                'revreview-quick-basic';
                                        # Uses messages 
'revreview-quick-quality-same', 'revreview-quick-basic-same'
                                        $msg = $synced ? "{$msg}-same" : $msg;
-                                       $msgHTML = $this->msg( $msg, 
$srev->getRevId() )->numParams( $revsSince )->parse();
+                                       $msgHTML = $this->msg( $msg, 
$srev->getRevId() )
+                                               ->numParams( $revsSince 
)->parse();
                                }
                                $msgHTML = $prot . $icon . $msgHTML;
                                $tag = FlaggedRevsXML::prettyRatingBox( $srev, 
$msgHTML,
@@ -670,7 +677,8 @@
                                        $msg .= '-i';
                                }
                                $tag = $prot . $icon;
-                               $tag .= $this->msg( $msg, $srev->getRevId(), 
$time )->numParams( $revsSince )->parse();
+                               $tag .= $this->msg( $msg, $srev->getRevId(), 
$time )
+                                       ->numParams( $revsSince )->parse();
                                if ( !empty( $flags ) ) {
                                        $tag .= FlaggedRevsXML::ratingToggle();
                                        $tag .= "<div 
id='mw-fr-revisiondetails'>" .
@@ -832,16 +840,17 @@
                                $multiNotice . "</td></tr>";
                }
                return
-                       "<table border='0' cellpadding='0' cellspacing='4' 
style='width: 98%;' class='$tableClass'>" .
+                       "<table border='0' cellpadding='0' cellspacing='4' 
style='width: 98%;' " .
+                               "class='$tableClass'>" .
                                "<col class='diff-marker' />" .
                                "<col class='diff-content' />" .
                                "<col class='diff-marker' />" .
                                "<col class='diff-content' />" .
                                "<tr>" .
-                                       "<td colspan='2' style='text-align: 
center; width: 50%;' class='diff-otitle'><b>" .
-                                               $leftStatus . "</b></td>" .
-                                       "<td colspan='2' style='text-align: 
center; width: 50%;' class='diff-ntitle'><b>" .
-                                               $rightStatus . "</b></td>" .
+                                       "<td colspan='2' style='text-align: 
center; width: 50%;' class='diff-otitle'>" .
+                                               "<b>" . $leftStatus . 
"</b></td>" .
+                                       "<td colspan='2' style='text-align: 
center; width: 50%;' class='diff-ntitle'>" .
+                                               "<b>" . $rightStatus . 
"</b></td>" .
                                "</tr>" .
                                $multiNotice .
                                $diffBody .
@@ -898,7 +907,9 @@
                $displayFile = wfFindFile( $title, [ 'time' => $time ] );
                # If none found, try current
                if ( !$displayFile ) {
-                       wfDebug( __METHOD__ . ": {$title->getPrefixedDBkey()}: 
$time not found, using current\n" );
+                       wfDebug(
+                               __METHOD__ . ": {$title->getPrefixedDBkey()}: 
$time not found, using current\n"
+                       );
                        $displayFile = wfFindFile( $title );
                        # If none found, use a valid local placeholder
                        if ( !$displayFile ) {
@@ -945,15 +956,20 @@
                // HACK this duplicates logic from addToEditView()
                $log = $this->stabilityLogNotice( false );
                if ( $log ) {
-                       $notices[$this->article->isPageLocked() ? 
'revreview-locked' : 'revreview-unlocked'] = $log;
+                       $notices[$this->article->isPageLocked()
+                               ? 'revreview-locked'
+                               : 'revreview-unlocked'] = $log;
                } elseif ( $this->editWillRequireReview( $editPage ) ) {
                        $notices['revreview-editnotice'] = $this->msg( 
'revreview-editnotice' )->parseAsBlock();
                }
                $frev = $this->article->getStableRev();
                if ( $frev && $this->article->revsArePending() ) {
                        $revsSince = $this->article->getPendingRevCount();
-                       $pendingMsg = FlaggedRevsXML::pendingEditNoticeMessage( 
$this->article, $frev, $revsSince );
-                       $notices[$pendingMsg->getKey()] = '<div 
class="plainlinks">' . $pendingMsg->parseAsBlock() . '</div>';
+                       $pendingMsg = FlaggedRevsXML::pendingEditNoticeMessage(
+                               $this->article, $frev, $revsSince
+                       );
+                       $notices[$pendingMsg->getKey()] = '<div 
class="plainlinks">'
+                               . $pendingMsg->parseAsBlock() . '</div>';
                }
                $latestId = $this->article->getLatest();
                $revId  = $oldid ? $oldid : $latestId;
@@ -969,7 +985,9 @@
                                FlaggedRevsXML::diffToggle( $diffUrl );
                }
 
-               if ( $this->article->onlyTemplatesOrFilesPending() && 
$this->article->getPendingRevCount() == 0 ) {
+               if ( $this->article->onlyTemplatesOrFilesPending() &&
+                       $this->article->getPendingRevCount() == 0
+               ) {
                        $this->setPendingNotice( $frev, '', false );
                        $notices['review-transclusions'] = $this->reviewNotice;
                }
@@ -1173,7 +1191,8 @@
                        $form->setFileVersion( $this->out->getFileVersion() );
                        # $wgOut might not have the inclusion IDs, such as for 
diffs with diffonly=1.
                        # If they're lacking, then we use getRevIncludes() to 
get the draft inclusion versions.
-                       # Note: showStableVersion() already makes sure that 
$wgOut has the stable inclusion versions.
+                       # Note: showStableVersion() already makes sure that 
$wgOut
+                       # has the stable inclusion versions.
                        if ( $this->out->getRevisionId() == $rev->getId() ) {
                                $tmpVers = $this->out->getTemplateIds();
                                $fileVers = $this->out->getFileSearchOptions();
@@ -1219,15 +1238,18 @@
                        # Give a link to the page to configure the stable 
version
                        $frev = $this->article->getStableRev();
                        if ( $frev && $frev->getRevId() == 
$this->article->getLatest() ) {
-                               $this->out->prependHTML( "<span 
class='revreview-visibility revreview-visibility-synced plainlinks'>" .
+                               $this->out->prependHTML(
+                                       "<span class='revreview-visibility 
revreview-visibility-synced plainlinks'>" .
                                        $this->msg( 
'revreview-visibility-synced',
                                                $title->getPrefixedText() 
)->parse() . "</span>" );
                        } elseif ( $frev ) {
-                               $this->out->prependHTML( "<span 
class='revreview-visibility revreview-visibility-outdated plainlinks'>" .
+                               $this->out->prependHTML(
+                                       "<span class='revreview-visibility 
revreview-visibility-outdated plainlinks'>" .
                                        $this->msg( 
'revreview-visibility-outdated',
                                                $title->getPrefixedText() 
)->parse() . "</span>" );
                        } else {
-                               $this->out->prependHTML( "<span 
class='revreview-visibility revreview-visibility-nostable plainlinks'>" .
+                               $this->out->prependHTML(
+                                       "<span class='revreview-visibility 
revreview-visibility-nostable plainlinks'>" .
                                        $this->msg( 
'revreview-visibility-nostable',
                                                $title->getPrefixedText() 
)->parse() . "</span>" );
                        }
@@ -1418,10 +1440,13 @@
         * Adds a notice saying that this revision is pending review
         * @param FlaggedRevision $srev The stable version
         * @param string $diffToggle either "" or " <diff toggle><diff div>"
-        * @param boolean $background Whether to add the 'flaggedrevs_preview' 
CSS class (the blue background)
+        * @param boolean $background Whether to add the 'flaggedrevs_preview' 
CSS class
+        *   (the blue background)
         * @return void
         */
-       public function setPendingNotice( FlaggedRevision $srev, $diffToggle = 
'', $background = true ) {
+       public function setPendingNotice(
+               FlaggedRevision $srev, $diffToggle = '', $background = true
+       ) {
                $this->load();
                $time = $this->getLanguage()->date( $srev->getTimestamp(), true 
);
                $revsSince = $this->article->getPendingRevCount();
@@ -1521,7 +1546,8 @@
                                        } else {
                                                $msg = 'revreview-update'; // 
generic "please review" notice...
                                        }
-                                       $this->diffNoticeBox = $this->msg( $msg 
)->parseAsBlock(); // add as part of form
+                                       // add as part of form
+                                       $this->diffNoticeBox = $this->msg( $msg 
)->parseAsBlock();
                                }
                                # Add include change list...
                                if ( count( $changeList ) ) { // just inclusion 
changes
@@ -1806,7 +1832,9 @@
                        return true; // edit will go live or be reviewed on save
                }
                if ( extension_loaded( 'domxml' ) ) {
-                       wfDebug( "Warning: you have the obsolete domxml 
extension for PHP. Please remove it!\n" );
+                       wfDebug(
+                               "Warning: you have the obsolete domxml 
extension for PHP. Please remove it!\n"
+                       );
                        return true; # PECL extension conflicts with the core 
DOM extension (see bug 13770)
                } elseif ( isset( $buttons['save'] ) && extension_loaded( 'dom' 
) ) {
                        $dom = new DOMDocument();
@@ -1814,7 +1842,8 @@
                        foreach ( $dom->getElementsByTagName( 'input' ) as 
$input ) { // one <input>
                                $buttonLabel = $this->msg( 
'revreview-submitedit' )->text();
                                $input->setAttribute( 'value', $buttonLabel );
-                               // This attempts to re-implement 
Linker::titleAttrib(); TODO, consider a re-use pattern
+                               // This attempts to re-implement 
Linker::titleAttrib();
+                               // TODO, consider a re-use pattern
                                $buttonTitle = $this->msg( 
'revreview-submitedit-title' )->text() . ' ' .
                                        $this->msg( 'brackets', $this->msg( 
'accesskey-save' )->text() )->text();
                                $input->setAttribute( 'title', $buttonTitle ); 
// keep accesskey
@@ -1919,7 +1948,8 @@
                                if ( $this->article->revsArePending() ) {
                                        $n = 
$this->article->getPendingRevCount();
                                        $options['title-message'] = 
'revreview-check-flag-p-title';
-                                       $options['label-message'] = $this->msg( 
'revreview-check-flag-p' )->numParams( $n );
+                                       $options['label-message'] = $this->msg( 
'revreview-check-flag-p' )
+                                               ->numParams( $n );
                                // For just the user's changes...
                                } else {
                                        $options['title-message'] = 
'revreview-check-flag-y-title';
@@ -1942,7 +1972,8 @@
                                );
                                $attribs = [ 'for' => $options['id'] ];
                                $attribs['title'] = $this->msg( 
$options['title-message'] )->text();
-                               $label = Xml::tags( 'label', $attribs, 
$this->msg( $options['label-message'] )->parse() );
+                               $label = Xml::tags( 'label', $attribs,
+                                       $this->msg( $options['label-message'] 
)->parse() );
                                $checkboxes[ $options['legacy-name'] ] = 
$checkbox . '&#160;' . $label;
                        }
                }
diff --git a/frontend/FlaggedRevsXML.php b/frontend/FlaggedRevsXML.php
index ad7e9c8..db3eab2 100644
--- a/frontend/FlaggedRevsXML.php
+++ b/frontend/FlaggedRevsXML.php
@@ -64,7 +64,8 @@
        public static function getLevelMenu(
                $selected = null, $all = 'revreview-filter-all', $max = 2
        ) {
-               $s = "<label for='wpLevel'>" . wfMessage( 
'revreview-levelfilter' )->escaped() . "</label>\n";
+               $s = "<label for='wpLevel'>" . wfMessage( 
'revreview-levelfilter' )->escaped() .
+                       "</label>\n";
                $s .= Xml::openElement( 'select', [ 'name' => 'level', 'id' => 
'wpLevel' ] );
                if ( $all !== false ) {
                        $s .= Xml::option( wfMessage( $all )->text(), - 1, 
$selected === - 1 );
@@ -139,7 +140,8 @@
         * @return string
         */
        public static function getStatusFilterMenu( $selected = null ) {
-               $s = "<label for='wpStatus'>" . wfMessage( 
'revreview-statusfilter' )->escaped() . "</label>\n";
+               $s = "<label for='wpStatus'>" . wfMessage( 
'revreview-statusfilter' )->escaped() .
+                       "</label>\n";
                $s .= Xml::openElement( 'select', [ 'name' => 'status', 'id' => 
'wpStatus' ] );
                $s .= Xml::option( wfMessage( "revreview-filter-all" )->text(), 
- 1, $selected === - 1 );
                $s .= Xml::option( wfMessage( "revreview-filter-approved" 
)->text(), 1, $selected === 1 );
@@ -155,7 +157,8 @@
         * @return string
         */
        public static function getAutoFilterMenu( $selected = null ) {
-               $s = "<label for='wpApproved'>" . wfMessage( 
'revreview-typefilter' )->escaped() . "</label>\n";
+               $s = "<label for='wpApproved'>" . wfMessage( 
'revreview-typefilter' )->escaped() .
+                       "</label>\n";
                $s .= Xml::openElement( 'select', [ 'name' => 'automatic', 'id' 
=> 'wpApproved' ] );
                $s .= Xml::option( wfMessage( "revreview-filter-all" )->text(), 
- 1, $selected === - 1 );
                $s .= Xml::option( wfMessage( "revreview-filter-manual" 
)->text(), 0, $selected === 0 );
@@ -198,13 +201,15 @@
        public static function addTagRatings( $flags, $prettyBox = false, $css 
= '' ) {
                $tag = '';
                if ( $prettyBox ) {
-                       $tag .= "<table id='mw-fr-revisionratings-box' 
style='margin: auto;' class='$css' cellpadding='0'>";
+                       $tag .= "<table id='mw-fr-revisionratings-box' 
style='margin: auto;' class='$css' " .
+                               "cellpadding='0'>";
                }
                foreach ( FlaggedRevs::getTags() as $quality ) {
                        // Give grep a chance to find the usages:
-                       // revreview-accuracy-0, revreview-accuracy-1, 
revreview-accuracy-2, revreview-accuracy-3, revreview-accuracy-4,
-                       // revreview-depth-0, revreview-depth-1, 
revreview-depth-2, revreview-depth-3, revreview-depth-4,
-                       // revreview-style-0, revreview-style-1, 
revreview-style-2, revreview-style-3, revreview-style-4
+                       // revreview-accuracy-0, revreview-accuracy-1, 
revreview-accuracy-2,
+                       // revreview-accuracy-3, revreview-accuracy-4, 
revreview-depth-0, revreview-depth-1,
+                       // revreview-depth-2, revreview-depth-3, 
revreview-depth-4, revreview-style-0,
+                       // revreview-style-1, revreview-style-2, 
revreview-style-3, revreview-style-4
                        $level = isset( $flags[$quality] ) ? $flags[$quality] : 
0;
                        $encValueText = wfMessage( "revreview-$quality-$level" 
)->escaped();
                        $level = $flags[$quality];
@@ -323,7 +328,8 @@
         */
        public static function ratingToggle() {
                return '<a id="mw-fr-revisiontoggle" class="fr-toggle-symbol"' .
-                       ' style="display:none;" title="' . wfMessage( 
'revreview-toggle-title' )->escaped() . '" >' .
+                       ' style="display:none;" title="' .
+                       wfMessage( 'revreview-toggle-title' )->escaped() . '" 
>' .
                        wfMessage( 'revreview-toggle-show' )->escaped() . 
'</a>';
        }
 
diff --git a/frontend/RevisionReviewFormUI.php 
b/frontend/RevisionReviewFormUI.php
index ae8bc23..a4b466f 100644
--- a/frontend/RevisionReviewFormUI.php
+++ b/frontend/RevisionReviewFormUI.php
@@ -19,7 +19,9 @@
         * @param FlaggableWikiPage $article
         * @param Revision $rev
         */
-       public function __construct( IContextSource $context, FlaggableWikiPage 
$article, Revision $rev ) {
+       public function __construct(
+               IContextSource $context, FlaggableWikiPage $article, Revision 
$rev
+       ) {
                $this->user = $context->getUser();
                $this->request = $context->getRequest();
                $this->article = $article;
@@ -251,7 +253,9 @@
                if ( $this->refRev ) {
                        $priorId = $this->refRev->getId();
                        if ( $priorId == $this->article->getStable() && 
$priorId != $this->rev->getId() ) {
-                               if ( $this->rev->getContent( Revision::RAW ) != 
$this->refRev->getContent( Revision::RAW ) ) {
+                               if ( $this->rev->getContent( Revision::RAW ) !=
+                                       $this->refRev->getContent( 
Revision::RAW )
+                               ) {
                                        return $priorId; // left rev must be 
stable and right one newer
                                }
                        }
@@ -424,14 +428,18 @@
 
        protected function getFileVersion() {
                if ( $this->fileVersion === null ) {
-                       throw new Exception( "File page file version not 
provided to review form; call setFileVersion()." );
+                       throw new Exception(
+                               "File page file version not provided to review 
form; call setFileVersion()."
+                       );
                }
                return $this->fileVersion;
        }
 
        protected function getIncludeVersions() {
                if ( $this->templateIDs === null || $this->imageSHA1Keys === 
null ) {
-                       throw new Exception( "Template or file versions not 
provided to review form; call setIncludeVersions()." );
+                       throw new Exception(
+                               "Template or file versions not provided to 
review form; call setIncludeVersions()."
+                       );
                }
                return [ $this->templateIDs, $this->imageSHA1Keys ];
        }
diff --git a/maintenance/fixBug28348.php b/maintenance/fixBug28348.php
index 6a06f81..9cabb67 100644
--- a/maintenance/fixBug28348.php
+++ b/maintenance/fixBug28348.php
@@ -76,7 +76,9 @@
                                        # Check if the fi_img_timestamp value 
is off by 1 second...
                                        $file = 
RepoGroup::singleton()->findFileFromKey( $sha1, [ 'time' => $time ] );
                                        if ( $file ) {
-                                               $this->output( "fixed file 
{$row->fi_name} reference in rev ID {$row->fi_rev_id}\n" );
+                                               $this->output(
+                                                       "fixed file 
{$row->fi_name} reference in rev ID {$row->fi_rev_id}\n"
+                                               );
                                                # Fix the fi_img_timestamp 
value...
                                                $db->update( 'flaggedimages',
                                                        [ 'fi_img_timestamp' => 
$db->timestamp( $time ) ],
@@ -93,7 +95,9 @@
                        $blockEnd += $this->mBatchSize;
                        wfWaitForSlaves( 5 );
                }
-               $this->output( "fi_img_timestamp column fixes complete ... 
{$count} rows [{$changed} changed]\n" );
+               $this->output(
+                       "fi_img_timestamp column fixes complete ... {$count} 
rows [{$changed} changed]\n"
+               );
        }
 }
 
diff --git a/maintenance/purgeReviewablePages.php 
b/maintenance/purgeReviewablePages.php
index c0bbe0b..5327bb9 100644
--- a/maintenance/purgeReviewablePages.php
+++ b/maintenance/purgeReviewablePages.php
@@ -14,8 +14,10 @@
 
        public function __construct() {
                $this->mDescription = "Use to purge squid/file cache for all 
reviewable pages";
-               $this->addOption( 'makelist', "Build the list of reviewable 
pages to pagesToPurge.list", false, false );
-               $this->addOption( 'purgelist', "Purge the list of pages in 
pagesToPurge.list", false, false );
+               $this->addOption( 'makelist',
+                       "Build the list of reviewable pages to 
pagesToPurge.list", false, false );
+               $this->addOption( 'purgelist',
+                       "Purge the list of pages in pagesToPurge.list", false, 
false );
                $this->setBatchSize( 1000 );
        }
 
diff --git a/phpcs.xml b/phpcs.xml
index cadccd9..b03fda8 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,7 +2,6 @@
 <ruleset>
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude 
name="Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed"/>
-               <exclude name="Generic.Files.LineLength.TooLong"/>
                <exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
                <exclude 
name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
@@ -18,6 +17,9 @@
                <exclude 
name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
        </rule>
+       <rule ref="Generic.Files.LineLength">
+               <exclude-pattern>frontend/language/</exclude-pattern>
+       </rule>
        <file>.</file>
        <arg name="extensions" value="php,php5,inc" />
        <arg name="encoding" value="UTF-8" />
diff --git a/scribunto/FlaggedRevs.library.php 
b/scribunto/FlaggedRevs.library.php
index 89f062a..5c61ff4 100644
--- a/scribunto/FlaggedRevs.library.php
+++ b/scribunto/FlaggedRevs.library.php
@@ -6,11 +6,15 @@
                        'getStabilitySettings' => [ $this, 
'getStabilitySettings' ],
                ];
 
-               return $this->getEngine()->registerInterface( __DIR__ . 
'/mw.ext.FlaggedRevs.lua', $lib, [] );
+               return $this->getEngine()->registerInterface(
+                       __DIR__ . '/mw.ext.FlaggedRevs.lua', $lib, []
+               );
        }
 
        public function getStabilitySettings( $pagename = null ) {
-               $this->checkTypeOptional( 
'mw.ext.FlaggedRevs.getStabilitySettings', 1, $pagename, 'string', null );
+               $this->checkTypeOptional(
+                       'mw.ext.FlaggedRevs.getStabilitySettings', 1, 
$pagename, 'string', null
+               );
                if ( $pagename ) {
                        $title = Title::newFromText( $pagename );
                        if ( !( $title instanceof Title ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/364118
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie683924e7ebbae91bcc0cbd7d80621ec1b3aacc7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to