X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fauth%2FLegacyHookPreAuthenticationProvider.php;h=e8a276cc2decdc278cd483e05da992dfea37e6f5;hb=8085c58a4b675c0c11c6454bdf15b3ba61022283;hp=97bbde75320e352b8e92cc8406e11bb4e40a4e8b;hpb=74426f3cf796b149f1ae445e41815bbe148640b2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/auth/LegacyHookPreAuthenticationProvider.php b/includes/auth/LegacyHookPreAuthenticationProvider.php index 97bbde7532..e8a276cc2d 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? @@ -169,7 +168,7 @@ class LegacyHookPreAuthenticationProvider extends AbstractPreAuthenticationProvi case LoginForm::USER_MIGRATED: $error = $msg ?: 'login-migrated-generic'; - return call_user_func_array( 'StatusValue::newFatal', (array)$error ); + return StatusValue::newFatal( ...(array)$error ); // @codeCoverageIgnoreStart case LoginForm::CREATE_BLOCKED: // Can never happen