Pass phpcs-strict on includes/specials/ (1/3)
authorSiebrand Mazeland <siebrand@kitano.nl>
Fri, 9 May 2014 19:33:58 +0000 (21:33 +0200)
committerSiebrand Mazeland <siebrand@kitano.nl>
Fri, 9 May 2014 19:33:58 +0000 (21:33 +0200)
Change-Id: Ib4522f22551ed5501e1ab7767b8f481fe6cd72d2

includes/specials/SpecialActiveusers.php
includes/specials/SpecialBlock.php
includes/specials/SpecialBlockList.php
includes/specials/SpecialBooksources.php
includes/specials/SpecialBrokenRedirects.php
includes/specials/SpecialCachedPage.php
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialChangePassword.php
includes/specials/SpecialContributions.php
includes/specials/SpecialCreateAccount.php

index d963677..c42c089 100644 (file)
@@ -31,7 +31,6 @@
  * @ingroup SpecialPage
  */
 class ActiveUsersPager extends UsersPager {
-
        /**
         * @var FormOptions
         */
@@ -194,20 +193,31 @@ class ActiveUsersPager extends UsersPager {
                $self = $this->getTitle();
                $limit = $this->mLimit ? Html::hidden( 'limit', $this->mLimit ) : '';
 
-               $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); # Form tag
+               # Form tag
+               $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
                $out .= Xml::fieldset( $this->msg( 'activeusers' )->text() ) . "\n";
                $out .= Html::hidden( 'title', $self->getPrefixedDBkey() ) . $limit . "\n";
 
+               # Username field
                $out .= Xml::inputLabel( $this->msg( 'activeusers-from' )->text(),
-                       'username', 'offset', 20, $this->requestedUser, array( 'tabindex' => 1 ) ) . '<br />';# Username field
+                       'username', 'offset', 20, $this->requestedUser, array( 'tabindex' => 1 ) ) . '<br />';
 
                $out .= Xml::checkLabel( $this->msg( 'activeusers-hidebots' )->text(),
                        'hidebots', 'hidebots', $this->opts->getValue( 'hidebots' ), array( 'tabindex' => 2 ) );
 
-               $out .= Xml::checkLabel( $this->msg( 'activeusers-hidesysops' )->text(),
-                       'hidesysops', 'hidesysops', $this->opts->getValue( 'hidesysops' ), array( 'tabindex' => 3 ) ) . '<br />';
-
-               $out .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text(), array( 'tabindex' => 4 ) ) . "\n";# Submit button and form bottom
+               $out .= Xml::checkLabel(
+                       $this->msg( 'activeusers-hidesysops' )->text(),
+                       'hidesysops',
+                       'hidesysops',
+                       $this->opts->getValue( 'hidesysops' ),
+                       array( 'tabindex' => 3 )
+               ) . '<br />';
+
+               # Submit button and form bottom
+               $out .= Xml::submitButton(
+                       $this->msg( 'allpagessubmit' )->text(),
+                       array( 'tabindex' => 4 )
+               ) . "\n";
                $out .= Xml::closeElement( 'fieldset' );
                $out .= Xml::closeElement( 'form' );
 
index 716bf80..007850b 100644 (file)
@@ -84,7 +84,8 @@ class SpecialBlock extends FormSpecialPage {
                        $this->getSkin()->setRelevantUser( $this->target );
                }
 
-               list( $this->previousTarget, /*...*/ ) = Block::parseTarget( $request->getVal( 'wpPreviousTarget' ) );
+               list( $this->previousTarget, /*...*/ ) =
+                       Block::parseTarget( $request->getVal( 'wpPreviousTarget' ) );
                $this->requestedHideUser = $request->getBool( 'wpHideUser' );
        }
 
@@ -361,7 +362,10 @@ class SpecialBlock extends FormSpecialPage {
 
                # Link to unblock the specified user, or to a blank unblock form
                if ( $this->target instanceof User ) {
-                       $message = $this->msg( 'ipb-unblock-addr', wfEscapeWikiText( $this->target->getName() ) )->parse();
+                       $message = $this->msg(
+                               'ipb-unblock-addr',
+                               wfEscapeWikiText( $this->target->getName() )
+                       )->parse();
                        $list = SpecialPage::getTitleFor( 'Unblock', $this->target->getName() );
                } else {
                        $message = $this->msg( 'ipb-unblock' )->parse();
@@ -451,7 +455,7 @@ class SpecialBlock extends FormSpecialPage {
 
        /**
         * Determine the target of the block, and the type of target
-        * TODO: should be in Block.php?
+        * @todo Should be in Block.php?
         * @param string $par subpage parameter passed to setup, or data value from
         *     the HTMLForm
         * @param WebRequest $request Optionally try and get data from a request too
@@ -765,7 +769,11 @@ class SpecialBlock extends FormSpecialPage {
 
                # Can't watch a rangeblock
                if ( $type != Block::TYPE_RANGE && $data['Watch'] ) {
-                       WatchAction::doWatch( Title::makeTitle( NS_USER, $target ), $performer, WatchedItem::IGNORE_USER_RIGHTS );
+                       WatchAction::doWatch(
+                               Title::makeTitle( NS_USER, $target ),
+                               $performer,
+                               WatchedItem::IGNORE_USER_RIGHTS
+                       );
                }
 
                # Block constructor sanitizes certain block options on insert
index 4c9a682..9170e3e 100644 (file)
@@ -27,8 +27,9 @@
  * @ingroup SpecialPage
  */
 class SpecialBlockList extends SpecialPage {
+       protected $target;
 
-       protected $target, $options;
+       protected $options;
 
        function __construct() {
                parent::__construct( 'BlockList' );
@@ -203,7 +204,11 @@ class SpecialBlockList extends SpecialPage {
                        foreach ( $otherBlockLink as $link ) {
                                $list .= Html::rawElement( 'li', array(), $link ) . "\n";
                        }
-                       $out->addHTML( Html::rawElement( 'ul', array( 'class' => 'mw-ipblocklist-otherblocks' ), $list ) . "\n" );
+                       $out->addHTML( Html::rawElement(
+                               'ul',
+                               array( 'class' => 'mw-ipblocklist-otherblocks' ),
+                               $list
+                       ) . "\n" );
                }
        }
 
@@ -471,11 +476,15 @@ class HTMLBlockedUsersItemSelect extends HTMLSelectField {
                }
 
                // Let folks pick an explicit limit not from our list, as long as it's a real numbr.
-               if ( !in_array( $value, $this->mParams['options'] ) && $value == intval( $value ) && $value > 0 ) {
+               if ( !in_array( $value, $this->mParams['options'] )
+                       && $value == intval( $value )
+                       && $value > 0
+               ) {
                        // This adds the explicitly requested limit value to the drop-down,
                        // then makes sure it's sorted correctly so when we output the list
                        // later, the custom option doesn't just show up last.
-                       $this->mParams['options'][$this->mParent->getLanguage()->formatNum( $value )] = intval( $value );
+                       $this->mParams['options'][$this->mParent->getLanguage()->formatNum( $value )] =
+                               intval( $value );
                        asort( $this->mParams['options'] );
                }
 
index 79636b1..581619f 100644 (file)
@@ -30,7 +30,6 @@
  * @ingroup SpecialPage
  */
 class SpecialBookSources extends SpecialPage {
-
        /**
         * ISBN passed to the page, if any
         */
@@ -55,7 +54,10 @@ class SpecialBookSources extends SpecialPage {
                $this->getOutput()->addHTML( $this->makeForm() );
                if ( strlen( $this->isbn ) > 0 ) {
                        if ( !self::isValidISBN( $this->isbn ) ) {
-                               $this->getOutput()->wrapWikiMsg( "<div class=\"error\">\n$1\n</div>", 'booksources-invalid-isbn' );
+                               $this->getOutput()->wrapWikiMsg(
+                                       "<div class=\"error\">\n$1\n</div>",
+                                       'booksources-invalid-isbn'
+                               );
                        }
                        $this->showList();
                }
@@ -118,10 +120,21 @@ class SpecialBookSources extends SpecialPage {
                global $wgScript;
 
                $form = Html::openElement( 'fieldset' ) . "\n";
-               $form .= Html::element( 'legend', array(), $this->msg( 'booksources-search-legend' )->text() ) . "\n";
+               $form .= Html::element(
+                       'legend',
+                       array(),
+                       $this->msg( 'booksources-search-legend' )->text()
+               ) . "\n";
                $form .= Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . "\n";
                $form .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) . "\n";
-               $form .= '<p>' . Xml::inputLabel( $this->msg( 'booksources-isbn' )->text(), 'isbn', 'isbn', 20, $this->isbn, array( 'autofocus' => true ) );
+               $form .= '<p>' . Xml::inputLabel(
+                       $this->msg( 'booksources-isbn' )->text(),
+                       'isbn',
+                       'isbn',
+                       20,
+                       $this->isbn,
+                       array( 'autofocus' => true )
+               );
                $form .= '&#160;' . Xml::submitButton( $this->msg( 'booksources-go' )->text() ) . "</p>\n";
                $form .= Html::closeElement( 'form' ) . "\n";
                $form .= Html::closeElement( 'fieldset' ) . "\n";
index b2ddc22..1bbdbea 100644 (file)
@@ -28,7 +28,6 @@
  * @ingroup SpecialPage
  */
 class BrokenRedirectsPage extends QueryPage {
-
        function __construct( $name = 'BrokenRedirects' ) {
                parent::__construct( $name );
        }
@@ -148,7 +147,8 @@ class BrokenRedirectsPage extends QueryPage {
                        );
                }
 
-               $out .= $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->pipeList( $links ) )->escaped();
+               $out .= $this->msg( 'parentheses' )->rawParams( $this->getLanguage()
+                       ->pipeList( $links ) )->escaped();
                $out .= " {$arr} {$to}";
 
                return $out;
index 7763166..cb9b07c 100644 (file)
@@ -38,7 +38,6 @@
  * @since 1.20
  */
 abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper {
-
        /**
         * CacheHelper object to which we forward the non-SpecialPage specific caching work.
         * Initialized in startCache.
@@ -142,7 +141,11 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper {
         * @param string|null $key
         */
        public function addCachedHTML( $computeFunction, $args = array(), $key = null ) {
-               $this->getOutput()->addHTML( $this->cacheHelper->getCachedValue( $computeFunction, $args, $key ) );
+               $this->getOutput()->addHTML( $this->cacheHelper->getCachedValue(
+                       $computeFunction,
+                       $args,
+                       $key
+               ) );
        }
 
        /**
@@ -158,7 +161,8 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper {
        }
 
        /**
-        * Sets the time to live for the cache, in seconds or a unix timestamp indicating the point of expiry.
+        * Sets the time to live for the cache, in seconds or a unix timestamp
+        * indicating the point of expiry.
         *
         * @since 1.20
         *
index 07a2a86..c57e33b 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup SpecialPage
  */
 class SpecialChangeEmail extends UnlistedSpecialPage {
-
        /**
         * Users password
         * @var string
@@ -233,13 +232,19 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
                $throttleCount = LoginForm::incLoginThrottle( $user->getName() );
                if ( $throttleCount === true ) {
                        $lang = $this->getLanguage();
-                       $this->error( array( 'changeemail-throttled', $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) );
+                       $this->error( array(
+                               'changeemail-throttled',
+                               $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] )
+                       ) );
 
                        return false;
                }
 
                global $wgRequirePasswordforEmailChange;
-               if ( $wgRequirePasswordforEmailChange && !$user->checkTemporaryPassword( $pass ) && !$user->checkPassword( $pass ) ) {
+               if ( $wgRequirePasswordforEmailChange
+                       && !$user->checkTemporaryPassword( $pass )
+                       && !$user->checkPassword( $pass )
+               ) {
                        $this->error( 'wrongpassword' );
 
                        return false;
index 8afbf4b..f4ce882 100644 (file)
@@ -27,8 +27,8 @@
  * @ingroup SpecialPage
  */
 class SpecialChangePassword extends FormSpecialPage {
-
-       protected $mUserName, $mDomain;
+       protected $mUserName;
+       protected $mDomain;
 
        // Optional Wikitext Message to show above the password change form
        protected $mPreTextMessage = null;
@@ -178,7 +178,6 @@ class SpecialChangePassword extends FormSpecialPage {
                        return false;
                }
 
-
                if ( $request->getCheck( 'wpCancel' ) ) {
                        $titleObj = Title::newFromText( $request->getVal( 'returnto' ) );
                        if ( !$titleObj instanceof Title ) {
index 6a4467c..0571d0d 100644 (file)
@@ -1055,7 +1055,8 @@ class ContribsPager extends ReverseChronologicalPager {
                        # Show user names for /newbies as there may be different users.
                        # Note that we already excluded rows with hidden user names.
                        if ( $this->contribs == 'newbie' ) {
-                               $userlink = ' . . ' . $lang->getDirMark() . Linker::userLink( $rev->getUser(), $rev->getUserText() );
+                               $userlink = ' . . ' . $lang->getDirMark()
+                                       . Linker::userLink( $rev->getUser(), $rev->getUserText() );
                                $userlink .= ' ' . $this->msg( 'parentheses' )->rawParams(
                                        Linker::userTalkLink( $rev->getUser(), $rev->getUserText() ) )->escaped() . ' ';
                        } else {
index d781e6d..448637e 100644 (file)
  */
 class SpecialCreateAccount extends SpecialRedirectToSpecial {
        function __construct() {
-               parent::__construct( 'CreateAccount', 'Userlogin', 'signup', array( 'returnto', 'returntoquery', 'uselang' ) );
+               parent::__construct(
+                       'CreateAccount',
+                       'Userlogin',
+                       'signup',
+                       array( 'returnto', 'returntoquery', 'uselang' )
+               );
        }
 
        // No reason to hide this link on Special:Specialpages