function UserAuthenticationController::__construct
Same name and namespace in other branches
- 10 core/modules/user/src/Controller/UserAuthenticationController.php \Drupal\user\Controller\UserAuthenticationController::__construct()
- 9 core/modules/user/src/Controller/UserAuthenticationController.php \Drupal\user\Controller\UserAuthenticationController::__construct()
- 8.9.x core/modules/user/src/Controller/UserAuthenticationController.php \Drupal\user\Controller\UserAuthenticationController::__construct()
- main core/modules/user/src/Controller/UserAuthenticationController.php \Drupal\user\Controller\UserAuthenticationController::__construct()
File
-
core/
modules/ user/ src/ Controller/ UserAuthenticationController.php, line 118
Class
- UserAuthenticationController
- Provides controllers for login, login status and logout via HTTP requests.
Namespace
Drupal\user\ControllerCode
public function __construct(UserFloodControlInterface $user_flood_control, UserStorageInterface $user_storage, CsrfTokenGenerator $csrf_token, UserAuthenticationInterface|UserAuthInterface $user_auth, RouteProviderInterface $route_provider, Serializer $serializer, array $serializer_formats, LoggerInterface $logger, ?LoginFinalizer $loginFinalizer = NULL, ?LogoutFinalizer $logoutFinalizer = NULL, ?NotificationHandler $notification_handler = NULL) {
$this->userFloodControl = $user_flood_control;
$this->userStorage = $user_storage;
$this->csrfToken = $csrf_token;
if (!$user_auth instanceof UserAuthenticationInterface) {
@trigger_error('The $user_auth parameter implementing UserAuthInterface is deprecated in drupal:10.3.0 and will be removed in drupal:12.0.0. Implement UserAuthenticationInterface instead. See https://www.drupal.org/node/3411040');
}
$this->userAuth = $user_auth;
$this->serializer = $serializer;
$this->serializerFormats = $serializer_formats;
$this->routeProvider = $route_provider;
$this->logger = $logger;
if ($loginFinalizer === NULL) {
@trigger_error('Calling ' . __METHOD__ . '() without the $loginFinalizer argument is deprecated in drupal:11.5.0 and it will be required from drupal:12.0.0. See https://www.drupal.org/node/3379194', E_USER_DEPRECATED);
$loginFinalizer = \Drupal::service(LoginFinalizer::class);
}
$this->loginFinalizer = $loginFinalizer;
if ($logoutFinalizer === NULL) {
@trigger_error('Calling ' . __METHOD__ . '() without the $logoutFinalizer argument is deprecated in drupal:11.5.0 and it will be required from drupal:12.0.0. See https://www.drupal.org/node/3379194', E_USER_DEPRECATED);
$logoutFinalizer = \Drupal::service(LogoutFinalizer::class);
}
$this->logoutFinalizer = $logoutFinalizer;
if ($notification_handler === NULL) {
@trigger_error('Calling ' . __CLASS__ . ' constructor without the $notificationHandler argument is deprecated in drupal:11.5.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/node/3539363', E_USER_DEPRECATED);
}
$this->notificationHandler = $notification_handler ?? \Drupal::service(NotificationHandler::class);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.