function UserLoginForm::__construct

Same name in other branches
  1. 8.9.x core/modules/user/src/Form/UserLoginForm.php \Drupal\user\Form\UserLoginForm::__construct()
  2. 10 core/modules/user/src/Form/UserLoginForm.php \Drupal\user\Form\UserLoginForm::__construct()
  3. 11.x core/modules/user/src/Form/UserLoginForm.php \Drupal\user\Form\UserLoginForm::__construct()

Constructs a new UserLoginForm.

Parameters

\Drupal\user\UserFloodControlInterface $user_flood_control: The user flood control service.

\Drupal\user\UserStorageInterface $user_storage: The user storage.

\Drupal\user\UserAuthInterface $user_auth: The user authentication object.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\Render\BareHtmlPageRendererInterface $bare_html_renderer: The renderer.

File

core/modules/user/src/Form/UserLoginForm.php, line 72

Class

UserLoginForm
Provides a user login form.

Namespace

Drupal\user\Form

Code

public function __construct($user_flood_control, UserStorageInterface $user_storage, UserAuthInterface $user_auth, RendererInterface $renderer, BareHtmlPageRendererInterface $bare_html_renderer = NULL) {
    if (!$user_flood_control instanceof UserFloodControlInterface) {
        @trigger_error('Passing the flood service to ' . __METHOD__ . ' is deprecated in drupal:9.1.0 and is replaced by user.flood_control in drupal:10.0.0. See https://www.drupal.org/node/3067148', E_USER_DEPRECATED);
        $user_flood_control = \Drupal::service('user.flood_control');
    }
    if (!$bare_html_renderer instanceof BareHtmlPageRendererInterface) {
        @trigger_error('Calling UserLoginForm::__construct() without the $bare_html_renderer argument is deprecated in drupal:9.4.0 and will be required before drupal:10.0.0. See https://www.drupal.org/node/3251987.', E_USER_DEPRECATED);
        $bare_html_renderer = \Drupal::service('bare_html_page_renderer');
    }
    $this->userFloodControl = $user_flood_control;
    $this->userStorage = $user_storage;
    $this->userAuth = $user_auth;
    $this->renderer = $renderer;
    $this->bareHtmlPageRenderer = $bare_html_renderer;
}

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