function UserController::__construct

Same name and namespace in other branches
  1. 11.x core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::__construct()
  2. 10 core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::__construct()
  3. 9 core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::__construct()
  4. 8.9.x core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::__construct()

File

core/modules/user/src/Controller/UserController.php, line 82

Class

UserController
Controller routines for user routes.

Namespace

Drupal\user\Controller

Code

public function __construct(DateFormatterInterface $date_formatter, UserStorageInterface $user_storage, UserDataInterface $user_data, LoggerInterface $logger, FloodInterface $flood, protected TimeInterface $time, ?OneTimeAuthentication $one_time_authentication = NULL, ?LoginFinalizer $loginFinalizer = NULL, ?LogoutFinalizer $logoutFinalizer = NULL) {
  $this->dateFormatter = $date_formatter;
  $this->userStorage = $user_storage;
  $this->userData = $user_data;
  $this->logger = $logger;
  $this->flood = $flood;
  if ($one_time_authentication === NULL) {
    @trigger_error('Calling ' . __METHOD__ . '() without the $one_time_authentication argument is deprecated in drupal:11.4.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/node/3581062', E_USER_DEPRECATED);
  }
  $this->oneTimeAuthentication = $one_time_authentication ?? \Drupal::service(OneTimeAuthentication::class);
  if ($loginFinalizer === NULL) {
    @trigger_error('Calling ' . __METHOD__ . '() without the $loginFinalizer argument is deprecated in drupal:11.5.0 and it will be required in 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 in drupal:12.0.0. See https://www.drupal.org/node/3379194', E_USER_DEPRECATED);
    $logoutFinalizer = \Drupal::service(LogoutFinalizer::class);
  }
  $this->logoutFinalizer = $logoutFinalizer;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.