Pass phpcs-strict on includes/specials/ (2/3)
authorSiebrand Mazeland <siebrand@kitano.nl>
Fri, 9 May 2014 19:34:13 +0000 (21:34 +0200)
committerSiebrand <siebrand@kitano.nl>
Sat, 10 May 2014 14:17:32 +0000 (14:17 +0000)
Change-Id: Ide979e5b948115afcec59d929516411c2e8346ae

includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialExport.php
includes/specials/SpecialImport.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialListgrouprights.php
includes/specials/SpecialLockdb.php
includes/specials/SpecialLog.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialMovepage.php

index f918708..409a6ae 100644 (file)
@@ -562,7 +562,8 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $context->setTitle( $this->getPageTitle() ); // Remove subpage
                $form = new EditWatchlistNormalHTMLForm( $fields, $context );
                $form->setSubmitTextMsg( 'watchlistedit-normal-submit' );
-               # Used message keys: 'accesskey-watchlistedit-normal-submit', 'tooltip-watchlistedit-normal-submit'
+               # Used message keys:
+               # 'accesskey-watchlistedit-normal-submit', 'tooltip-watchlistedit-normal-submit'
                $form->setSubmitTooltip( 'watchlistedit-normal-submit' );
                $form->setWrapperLegendMsg( 'watchlistedit-normal-legend' );
                $form->addHeaderText( $this->msg( 'watchlistedit-normal-explain' )->parse() );
@@ -603,7 +604,10 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        );
                }
 
-               wfRunHooks( 'WatchlistEditorBuildRemoveLine', array( &$tools, $title, $title->isRedirect(), $this->getSkin() ) );
+               wfRunHooks(
+                       'WatchlistEditorBuildRemoveLine',
+                       array( &$tools, $title, $title->isRedirect(), $this->getSkin() )
+               );
 
                return $link . " (" . $this->getLanguage()->pipeList( $tools ) . ")";
        }
index 487d979..bc8e728 100644 (file)
@@ -259,8 +259,14 @@ class SpecialExport extends SpecialPage {
                        ) . '<br />';
                }
 
-               // Enable this when we can do something useful exporting/importing image information. :)
-               //$form .= Xml::checkLabel( $this->msg( 'export-images' )->text(), 'images', 'wpExportImages', false ) . '<br />';
+               /* Enable this when we can do something useful exporting/importing image information.
+               $form .= Xml::checkLabel(
+                               $this->msg( 'export-images' )->text(),
+                               'images',
+                               'wpExportImages',
+                               false
+                       ) . '<br />';
+               */
                $form .= Xml::checkLabel(
                        $this->msg( 'export-download' )->text(),
                        'wpDownload',
@@ -510,7 +516,9 @@ class SpecialExport extends SpecialPage {
         * @return array
         */
        private function getPageLinks( $inputPages, $pageSet, $depth ) {
+               // @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
                for ( ; $depth > 0; --$depth ) {
+                       // @codingStandardsIgnoreEnd
                        $pageSet = $this->getLinks(
                                $inputPages, $pageSet, 'pagelinks',
                                array( 'namespace' => 'pl_namespace', 'title' => 'pl_title' ),
index 891962b..28e6479 100644 (file)
@@ -99,7 +99,9 @@ class SpecialImport extends SpecialPage {
                $sourceName = $request->getVal( "source" );
 
                $this->logcomment = $request->getText( 'log-comment' );
-               $this->pageLinkDepth = $wgExportMaxLinkDepth == 0 ? 0 : $request->getIntOrNull( 'pagelink-depth' );
+               $this->pageLinkDepth = $wgExportMaxLinkDepth == 0
+                       ? 0
+                       : $request->getIntOrNull( 'pagelink-depth' );
                $this->rootpage = $request->getText( 'rootpage' );
 
                $user = $this->getUser();
@@ -242,7 +244,10 @@ class SpecialImport extends SpecialPage {
                                </tr>
                                <tr>
                                        <td class='mw-label'>" .
-                                       Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-upload' ) .
+                                       Xml::label(
+                                               $this->msg( 'import-interwiki-rootpage' )->text(),
+                                               'mw-interwiki-rootpage-upload'
+                                       ) .
                                        "</td>
                                        <td class='mw-input'>" .
                                        Xml::input( 'rootpage', 50, $this->rootpage,
@@ -434,7 +439,9 @@ class ImportReporter extends ContextSource {
        }
 
        function reportNotice( $msg, array $params ) {
-               $this->getOutput()->addHTML( Html::element( 'li', array(), $this->msg( $msg, $params )->text() ) );
+               $this->getOutput()->addHTML(
+                       Html::element( 'li', array(), $this->msg( $msg, $params )->text() )
+               );
        }
 
        function reportLogItem( /* ... */ ) {
@@ -475,7 +482,8 @@ class ImportReporter extends ContextSource {
                                $detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
                                        $successCount )->inContentLanguage()->text();
                                if ( $this->reason ) {
-                                       $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
+                                       $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
+                                               . $this->reason;
                                }
                                $log->addEntry( 'upload', $title, $detail, array(), $this->getUser() );
                        } else {
@@ -484,7 +492,8 @@ class ImportReporter extends ContextSource {
                                $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams(
                                        $successCount )->params( $interwiki )->inContentLanguage()->text();
                                if ( $this->reason ) {
-                                       $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
+                                       $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
+                                               . $this->reason;
                                }
                                $log->addEntry( 'interwiki', $title, $detail, array(), $this->getUser() );
                        }
@@ -492,13 +501,23 @@ class ImportReporter extends ContextSource {
                        $comment = $detail; // quick
                        $dbw = wfGetDB( DB_MASTER );
                        $latest = $title->getLatestRevID();
-                       $nullRevision = Revision::newNullRevision( $dbw, $title->getArticleID(), $comment, true, $this->getUser() );
+                       $nullRevision = Revision::newNullRevision(
+                               $dbw,
+                               $title->getArticleID(),
+                               $comment,
+                               true,
+                               $this->getUser()
+                       );
+
                        if ( !is_null( $nullRevision ) ) {
                                $nullRevision->insertOn( $dbw );
                                $page = WikiPage::factory( $title );
                                # Update page record
                                $page->updateRevisionOn( $dbw, $nullRevision );
-                               wfRunHooks( 'NewRevisionFromEditComplete', array( $page, $nullRevision, $latest, $this->getUser() ) );
+                               wfRunHooks(
+                                       'NewRevisionFromEditComplete',
+                                       array( $page, $nullRevision, $latest, $this->getUser() )
+                               );
                        }
                } else {
                        $this->getOutput()->addHTML( "<li>" . Linker::linkKnown( $title ) . " " .
index 7982d5c..1c4f79f 100644 (file)
  * @ingroup SpecialPage
  */
 class SpecialJavaScriptTest extends SpecialPage {
-
        /**
-        * @var $frameworks Array: Mapping of framework ids and their initilizer methods
+        * @var array Mapping of framework ids and their initilizer methods
         * in this class. If a framework is requested but not in this array,
         * the 'unknownframework' error is served.
         */
-       static $frameworks = array(
+       private static $frameworks = array(
                'qunit' => 'initQUnitTesting',
        );
 
index f9caff6..6b54fe8 100644 (file)
@@ -68,14 +68,20 @@ class SpecialListFiles extends IncludableSpecialPage {
  * @ingroup SpecialPage Pager
  */
 class ImageListPager extends TablePager {
-       var $mFieldNames = null;
+       protected $mFieldNames = null;
+
        // Subclasses should override buildQueryConds instead of using $mQueryConds variable.
-       var $mQueryConds = array();
-       var $mUserName = null;
-       var $mSearch = '';
-       var $mIncluding = false;
-       var $mShowAll = false;
-       var $mTableName = 'image';
+       protected $mQueryConds = array();
+
+       protected $mUserName = null;
+
+       protected $mSearch = '';
+
+       protected $mIncluding = false;
+
+       protected $mShowAll = false;
+
+       protected $mTableName = 'image';
 
        function __construct( IContextSource $context, $userName = null, $search = '',
                $including = false, $showAll = false
@@ -298,7 +304,8 @@ class ImageListPager extends TablePager {
        function reallyDoQuery( $offset, $limit, $asc ) {
                $prevTableName = $this->mTableName;
                $this->mTableName = 'image';
-               list( $tables, $fields, $conds, $fname, $options, $join_conds ) = $this->buildQueryInfo( $offset, $limit, $asc );
+               list( $tables, $fields, $conds, $fname, $options, $join_conds ) =
+                       $this->buildQueryInfo( $offset, $limit, $asc );
                $imageRes = $this->mDb->select( $tables, $fields, $conds, $fname, $options, $join_conds );
                $this->mTableName = $prevTableName;
 
@@ -315,7 +322,8 @@ class ImageListPager extends TablePager {
                }
                $this->mIndexField = 'oi_' . substr( $this->mIndexField, 4 );
 
-               list( $tables, $fields, $conds, $fname, $options, $join_conds ) = $this->buildQueryInfo( $offset, $limit, $asc );
+               list( $tables, $fields, $conds, $fname, $options, $join_conds ) =
+                       $this->buildQueryInfo( $offset, $limit, $asc );
                $oldimageRes = $this->mDb->select( $tables, $fields, $conds, $fname, $options, $join_conds );
 
                $this->mTableName = $prevTableName;
@@ -360,11 +368,17 @@ class ImageListPager extends TablePager {
                                }
                        }
                }
+
+               // @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
                for ( ; $i < $limit && $topRes1; $i++ ) {
+                       // @codingStandardsIgnoreEnd
                        $resultArray[] = $topRes1;
                        $topRes1 = $res1->next();
                }
+
+               // @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
                for ( ; $i < $limit && $topRes2; $i++ ) {
+                       // @codingStandardsIgnoreEnd
                        $resultArray[] = $topRes2;
                        $topRes2 = $res2->next();
                }
index 31034f9..a77b70c 100644 (file)
@@ -29,9 +29,6 @@
  * @author Petr Kadlec <mormegil@centrum.cz>
  */
 class SpecialListGroupRights extends SpecialPage {
-       /**
-        * Constructor
-        */
        function __construct() {
                parent::__construct( 'Listgrouprights' );
        }
@@ -118,11 +115,12 @@ class SpecialListGroupRights extends SpecialPage {
                        $addgroups = isset( $wgAddGroups[$group] ) ? $wgAddGroups[$group] : array();
                        $removegroups = isset( $wgRemoveGroups[$group] ) ? $wgRemoveGroups[$group] : array();
                        $addgroupsSelf = isset( $wgGroupsAddToSelf[$group] ) ? $wgGroupsAddToSelf[$group] : array();
-                       $removegroupsSelf = isset( $wgGroupsRemoveFromSelf[$group] ) ? $wgGroupsRemoveFromSelf[$group] : array();
+                       $removegroupsSelf = isset( $wgGroupsRemoveFromSelf[$group] )
+                               ? $wgGroupsRemoveFromSelf[$group]
+                               : array();
 
                        $id = $group == '*' ? false : Sanitizer::escapeId( $group );
-                       $out->addHTML( Html::rawElement( 'tr', array( 'id' => $id ),
-                               "
+                       $out->addHTML( Html::rawElement( 'tr', array( 'id' => $id ), "
                                <td>$grouppage$grouplink</td>
                                        <td>" .
                                        $this->formatPermissions( $permissions, $revoke, $addgroups, $removegroups,
index 95ef951..3382405 100644 (file)
@@ -27,7 +27,7 @@
  * @ingroup SpecialPage
  */
 class SpecialLockdb extends FormSpecialPage {
-       var $reason = '';
+       protected $reason = '';
 
        public function __construct() {
                parent::__construct( 'Lockdb', 'siteadmin' );
index dd5ab93..6da6674 100644 (file)
@@ -80,7 +80,9 @@ class SpecialLog extends SpecialPage {
                $type = $opts->getValue( 'type' );
                if ( !LogPage::isLogType( $type ) ) {
                        $opts->setValue( 'type', '' );
-               } elseif ( isset( $wgLogRestrictions[$type] ) && !$this->getUser()->isAllowed( $wgLogRestrictions[$type] ) ) {
+               } elseif ( isset( $wgLogRestrictions[$type] )
+                       && !$this->getUser()->isAllowed( $wgLogRestrictions[$type] )
+               ) {
                        throw new PermissionsError( $wgLogRestrictions[$type] );
                }
 
index f799fc5..097f1b6 100644 (file)
  * @ingroup SpecialPage
  */
 class SpecialMergeHistory extends SpecialPage {
-       var $mAction, $mTarget, $mDest, $mTimestamp, $mTargetID, $mDestID, $mComment;
+       /** @var string */
+       protected $mAction;
 
-       /**
-        * @var Title
-        */
-       var $mTargetObj, $mDestObj;
+       /** @var string */
+       protected $mTarget;
+
+       /** @var string */
+       protected $mDest;
+
+       /** @var string */
+       protected $mTimestamp;
+
+       /** @var int */
+       protected $mTargetID;
+
+       /** @var int */
+       protected $mDestID;
+
+       /** @var string */
+       protected $mComment;
+
+       /** @var bool Was posted? */
+       protected $mMerge;
+
+       /** @var bool Was submitted? */
+       protected $mSubmitted;
+
+       /** @var Title */
+       protected $mTargetObj;
+
+       /** @var Title */
+       protected $mDestObj;
 
        public function __construct() {
                parent::__construct( 'MergeHistory', 'mergehistory' );
@@ -57,7 +83,9 @@ class SpecialMergeHistory extends SpecialPage {
                }
                $this->mComment = $request->getText( 'wpComment' );
 
-               $this->mMerge = $request->wasPosted() && $this->getUser()->matchEditToken( $request->getVal( 'wpEditToken' ) );
+               $this->mMerge = $request->wasPosted()
+                       && $this->getUser()->matchEditToken( $request->getVal( 'wpEditToken' ) );
+
                // target page
                if ( $this->mSubmitted ) {
                        $this->mTargetObj = Title::newFromURL( $this->mTarget );
@@ -203,7 +231,10 @@ class SpecialMergeHistory extends SpecialPage {
                                        <tr>
                                                <td>&#160;</td>
                                                <td class="mw-submit">' .
-                                       Xml::submitButton( $this->msg( 'mergehistory-submit' )->text(), array( 'name' => 'merge', 'id' => 'mw-merge-submit' ) ) .
+                                       Xml::submitButton(
+                                               $this->msg( 'mergehistory-submit' )->text(),
+                                               array( 'name' => 'merge', 'id' => 'mw-merge-submit' )
+                                       ) .
                                        '</td>
                                        </tr>' .
                                        Xml::closeElement( 'table' ) .
@@ -290,7 +321,8 @@ class SpecialMergeHistory extends SpecialPage {
                $comment = Linker::revComment( $rev );
 
                return Html::rawElement( 'li', array(),
-                       $this->msg( 'mergehistory-revisionrow' )->rawParams( $checkBox, $last, $pageLink, $userLink, $stxt, $comment )->escaped() );
+                       $this->msg( 'mergehistory-revisionrow' )
+                               ->rawParams( $checkBox, $last, $pageLink, $userLink, $stxt, $comment )->escaped() );
        }
 
        function merge() {
@@ -434,7 +466,11 @@ class SpecialMergeHistory extends SpecialPage {
 }
 
 class MergeHistoryPager extends ReverseChronologicalPager {
-       public $mForm, $mConds;
+       /** @var IContextSource */
+       public $mForm;
+
+       /** @var array */
+       public $mConds;
 
        function __construct( $form, $conds = array(), $source, $dest ) {
                $this->mForm = $form;
index 14d671c..dce5ad9 100644 (file)
  * @ingroup SpecialPage
  */
 class MovePageForm extends UnlistedSpecialPage {
-       /**
-        * Objects
-        * @var Title
-        */
-       var $oldTitle, $newTitle;
-       // Text input
-       var $reason;
+       /** @var Title */
+       protected $oldTitle;
+
+       /** @var Title */
+       protected $newTitle;
+
+
+       /** @var string Text input */
+       protected $reason;
+
        // Checks
-       var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared;
+
+       /** @var bool */
+       protected $moveTalk;
+
+       /** @var bool */
+       protected $deleteAndMove;
+
+       /** @var bool */
+       protected $moveSubpages;
+
+       /** @var bool */
+       protected $fixRedirects;
+
+       /** @var bool */
+       protected $leaveRedirect;
+
+       /** @var bool */
+       protected $moveOverShared;
 
        private $watch = false;
 
@@ -685,17 +705,20 @@ class MovePageForm extends UnlistedSpecialPage {
                                        );
 
                                        $newLink = Linker::linkKnown( $newSubpage );
-                                       $extraOutput[] = $this->msg( 'movepage-page-moved' )->rawParams( $oldLink, $newLink )->escaped();
+                                       $extraOutput[] = $this->msg( 'movepage-page-moved' )
+                                               ->rawParams( $oldLink, $newLink )->escaped();
                                        ++$count;
 
                                        if ( $count >= $wgMaximumMovedPages ) {
-                                               $extraOutput[] = $this->msg( 'movepage-max-pages' )->numParams( $wgMaximumMovedPages )->escaped();
+                                               $extraOutput[] = $this->msg( 'movepage-max-pages' )
+                                                       ->numParams( $wgMaximumMovedPages )->escaped();
                                                break;
                                        }
                                } else {
                                        $oldLink = Linker::linkKnown( $oldSubpage );
                                        $newLink = Linker::link( $newSubpage );
-                                       $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink, $newLink )->escaped();
+                                       $extraOutput[] = $this->msg( 'movepage-page-unmoved' )
+                                               ->rawParams( $oldLink, $newLink )->escaped();
                                }
                        }
                }