Merge "Fix CodeSniffer errors and warnings in includes/specials (1)"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 26 Mar 2014 15:51:42 +0000 (15:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 26 Mar 2014 15:51:42 +0000 (15:51 +0000)
1  2 
includes/specials/SpecialUserlogin.php

@@@ -27,7 -27,6 +27,6 @@@
   * @ingroup SpecialPage
   */
  class LoginForm extends SpecialPage {
        const SUCCESS = 0;
        const NO_NAME = 1;
        const ILLEGAL = 2;
        const NEED_TOKEN = 12;
        const WRONG_TOKEN = 13;
  
 -      var $mUsername, $mPassword, $mRetype, $mReturnTo, $mCookieCheck, $mPosted;
 -      var $mAction, $mCreateaccount, $mCreateaccountMail;
 -      var $mLoginattempt, $mRemember, $mEmail, $mDomain, $mLanguage;
 -      var $mSkipCookieCheck, $mReturnToQuery, $mToken, $mStickHTTPS;
 -      var $mType, $mReason, $mRealName;
 -      var $mAbortLoginErrorMsg = null;
 +      public $mAbortLoginErrorMsg = null;
 +
 +      protected $mUsername;
 +      protected $mPassword;
 +      protected $mRetype;
 +      protected $mReturnTo;
 +      protected $mCookieCheck;
 +      protected $mPosted;
 +      protected $mAction;
 +      protected $mCreateaccount;
 +      protected $mCreateaccountMail;
 +      protected $mLoginattempt;
 +      protected $mRemember;
 +      protected $mEmail;
 +      protected $mDomain;
 +      protected $mLanguage;
 +      protected $mSkipCookieCheck;
 +      protected $mReturnToQuery;
 +      protected $mToken;
 +      protected $mStickHTTPS;
 +      protected $mType;
 +      protected $mReason;
 +      protected $mRealName;
 +
        private $mTempPasswordUsed;
        private $mLoaded = false;
        private $mSecureLoginUrl;
  
 -      /**
 -       * @ var WebRequest
 -       */
 +      /** @var WebRequest */
        private $mOverrideRequest = null;
  
 -      /**
 -       * Effective request; set at the beginning of load
 -       *
 -       * @var WebRequest $mRequest
 -       */
 +      /** @var WebRequest Effective request; set at the beginning of load */
        private $mRequest = null;
  
        /**
                $this->mAction = $request->getVal( 'action' );
                $this->mRemember = $request->getCheck( 'wpRemember' );
                $this->mFromHTTP = $request->getBool( 'fromhttp', false );
-               $this->mStickHTTPS = ( !$this->mFromHTTP && $request->getProtocol() === 'https' ) || $request->getBool( 'wpForceHttps', false );
+               $this->mStickHTTPS = ( !$this->mFromHTTP && $request->getProtocol() === 'https' )
+                       || $request->getBool( 'wpForceHttps', false );
                $this->mLanguage = $request->getText( 'uselang' );
                $this->mSkipCookieCheck = $request->getCheck( 'wpSkipCookieCheck' );
-               $this->mToken = ( $this->mType == 'signup' ) ? $request->getVal( 'wpCreateaccountToken' ) : $request->getVal( 'wpLoginToken' );
+               $this->mToken = $this->mType == 'signup'
+                       ? $request->getVal( 'wpCreateaccountToken' )
+                       : $request->getVal( 'wpLoginToken' );
                $this->mReturnTo = $request->getVal( 'returnto', '' );
                $this->mReturnToQuery = $request->getVal( 'returntoquery', '' );
  
                }
  
                # Include checks that will include GlobalBlocking (Bug 38333)
-               $permErrors = $this->getPageTitle()->getUserPermissionsErrors( 'createaccount', $currentUser, true );
+               $permErrors = $this->getPageTitle()->getUserPermissionsErrors(
+                       'createaccount',
+                       $currentUser,
+                       true
+               );
                if ( count( $permErrors ) ) {
                        throw new PermissionsError( 'createaccount', $permErrors );
                }
                        return Status::newFatal( 'sorbs_create_account_reason' );
                }
  
-               // Normalize the name so that silly things don't cause "invalid username" errors.
-               // User::newFromName does some rather strict checking, rejecting e.g. leading/trailing/multiple spaces.
+               // Normalize the name so that silly things don't cause "invalid username"
+               // errors. User::newFromName does some rather strict checking, rejecting
+               // e.g. leading/trailing/multiple spaces.
                $title = Title::makeTitleSafe( NS_USER, $this->mUsername );
                if ( !is_object( $title ) ) {
                        return Status::newFatal( 'noname' );
  
                // Hook point to check for exempt from account creation throttle
                if ( !wfRunHooks( 'ExemptFromAccountCreationThrottle', array( $ip ) ) ) {
-                       wfDebug( "LoginForm::exemptFromAccountCreationThrottle: a hook allowed account creation w/o throttle\n" );
+                       wfDebug( "LoginForm::exemptFromAccountCreationThrottle: a hook " .
+                               "allowed account creation w/o throttle\n" );
                } else {
                        if ( ( $wgAccountCreationThrottle && $currentUser->isPingLimitable() ) ) {
                                $key = wfMemcKey( 'acctcreate', 'ip', $ip );
  
        function processLogin() {
                global $wgMemc, $wgLang, $wgSecureLogin, $wgPasswordAttemptThrottle,
-                          $wgInvalidPasswordReset;
+                       $wgInvalidPasswordReset;
  
                switch ( $this->authenticateUserData() ) {
                        case self::SUCCESS:
         * @param string $emailText message name of email text
         * @return Status object
         */
-       function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
+       function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle',
+               $emailText = 'passwordremindertext'
+       ) {
                global $wgNewPasswordExpiry;
  
                if ( $u->getEmail() == '' ) {