Merge "resourceloader: Disable a flaky MessageBlobStoreTest case" into REL1_31
[lhc/web/wiklou.git] / includes / exception / UserNotLoggedIn.php
index 02fca3d..6086d55 100644 (file)
  * 'exception-nologin' as a title and 'exception-nologin-text' for the message.
  *
  * @note In order for this exception to redirect, the error message passed to the
- * constructor has to be explicitly added to LoginForm::validErrorMessages or with
+ * constructor has to be explicitly added to LoginHelper::validErrorMessages or with
  * the LoginFormValidErrorMessages hook. Otherwise, the user will just be shown the message
  * rather than redirected.
  *
  * @par Example:
  * @code
  * if( $user->isAnon() ) {
- *     throw new UserNotLoggedIn();
+ *   throw new UserNotLoggedIn();
  * }
  * @endcode
  *
  * @par Example:
  * @code
  * if( $user->isAnon() ) {
- *     throw new UserNotLoggedIn( 'action-require-loggedin' );
+ *   throw new UserNotLoggedIn( 'action-require-loggedin' );
  * }
  * @endcode
  *
- * @see bug 37627
+ * @see T39627
  * @since 1.20
  * @ingroup Exception
  */
@@ -62,12 +62,12 @@ class UserNotLoggedIn extends ErrorPageError {
         * @param string $titleMsg A message key to set the page title.
         *        Optional, default: 'exception-nologin'
         * @param array $params Parameters to wfMessage().
-        *        Optional, default: array()
+        *        Optional, default: []
         */
        public function __construct(
                $reasonMsg = 'exception-nologin-text',
                $titleMsg = 'exception-nologin',
-               $params = array()
+               $params = []
        ) {
                parent::__construct( $titleMsg, $reasonMsg, $params );
        }
@@ -79,7 +79,7 @@ class UserNotLoggedIn extends ErrorPageError {
        public function report() {
                // If an unsupported message is used, don't try redirecting to Special:Userlogin,
                // since the message may not be compatible.
-               if ( !in_array( $this->msg, LoginForm::getValidErrorMessages() ) ) {
+               if ( !in_array( $this->msg, LoginHelper::getValidErrorMessages() ) ) {
                        parent::report();
                }
 
@@ -92,12 +92,12 @@ class UserNotLoggedIn extends ErrorPageError {
                // Title will be overridden by returnto
                unset( $query['title'] );
                // Redirect to Special:Userlogin
-               $output->redirect( SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( array(
+               $output->redirect( SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( [
                        // Return to this page when the user logs in
                        'returnto' => $context->getTitle()->getFullText(),
                        'returntoquery' => wfArrayToCgi( $query ),
                        'warning' => $this->msg,
-               ) ) );
+               ] ) );
 
                $output->output();
        }