From: Thiemo Mättig Date: Wed, 10 Jan 2018 13:34:35 +0000 (+0100) Subject: Remove unused code from LegacyHookPreAuthenticationProvider X-Git-Tag: 1.31.0-rc.0~664^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=commitdiff_plain;h=564c96b63c75921bb5e3ff6edb9a9fdf27417d43;p=lhc%2Fweb%2Fwiklou.git Remove unused code from LegacyHookPreAuthenticationProvider Change-Id: I699947fe02f649e24c957eb9790fcff91cb2c14a --- diff --git a/includes/auth/LegacyHookPreAuthenticationProvider.php b/includes/auth/LegacyHookPreAuthenticationProvider.php index 97bbde7532..95fe3ab852 100644 --- a/includes/auth/LegacyHookPreAuthenticationProvider.php +++ b/includes/auth/LegacyHookPreAuthenticationProvider.php @@ -58,14 +58,14 @@ class LegacyHookPreAuthenticationProvider extends AbstractPreAuthenticationProvi $msg = null; if ( !\Hooks::run( 'LoginUserMigrated', [ $user, &$msg ] ) ) { return $this->makeFailResponse( - $user, null, LoginForm::USER_MIGRATED, $msg, 'LoginUserMigrated' + $user, LoginForm::USER_MIGRATED, $msg, 'LoginUserMigrated' ); } $abort = LoginForm::ABORTED; $msg = null; if ( !\Hooks::run( 'AbortLogin', [ $user, $password, &$abort, &$msg ] ) ) { - return $this->makeFailResponse( $user, null, $abort, $msg, 'AbortLogin' ); + return $this->makeFailResponse( $user, $abort, $msg, 'AbortLogin' ); } return StatusValue::newGood(); @@ -103,7 +103,7 @@ class LegacyHookPreAuthenticationProvider extends AbstractPreAuthenticationProvi // Hook point to add extra creation throttles and blocks $this->logger->debug( __METHOD__ . ": a hook blocked auto-creation: $abortError\n" ); return $this->makeFailResponse( - $user, $user, LoginForm::ABORTED, $abortError, 'AbortAutoAccount' + $user, LoginForm::ABORTED, $abortError, 'AbortAutoAccount' ); } } @@ -114,13 +114,12 @@ class LegacyHookPreAuthenticationProvider extends AbstractPreAuthenticationProvi /** * Construct an appropriate failure response * @param User $user - * @param User|null $creator * @param int $constant One of the LoginForm::… constants * @param string|null $msg Optional message key, will be derived from $constant otherwise * @param string $hook Name of the hook for error logging and exception messages * @return StatusValue */ - protected function makeFailResponse( $user, $creator, $constant, $msg, $hook ) { + private function makeFailResponse( User $user, $constant, $msg, $hook ) { switch ( $constant ) { case LoginForm::SUCCESS: // WTF?