function UserPasswordForm::__construct

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

Constructs a UserPasswordForm object.

Parameters

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

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\Config\ConfigFactory $config_factory: The config factory.

\Drupal\Core\Flood\FloodInterface $flood: The flood service.

File

core/modules/user/src/Form/UserPasswordForm.php, line 57

Class

UserPasswordForm
Provides a user password reset form.

Namespace

Drupal\user\Form

Code

public function __construct(UserStorageInterface $user_storage, LanguageManagerInterface $language_manager, ConfigFactory $config_factory = NULL, FloodInterface $flood = NULL) {
    $this->userStorage = $user_storage;
    $this->languageManager = $language_manager;
    if (!$config_factory) {
        @trigger_error('Calling ' . __METHOD__ . ' without the $config_factory is deprecated in drupal:8.8.0 and is required before drupal:9.0.0. See https://www.drupal.org/node/1681832', E_USER_DEPRECATED);
        $config_factory = \Drupal::configFactory();
    }
    $this->configFactory = $config_factory;
    if (!$flood) {
        @trigger_error('Calling ' . __METHOD__ . ' without the $flood parameter is deprecated in drupal:8.8.0 and is required before drupal:9.0.0. See https://www.drupal.org/node/1681832', E_USER_DEPRECATED);
        $flood = \Drupal::service('flood');
    }
    $this->flood = $flood;
}

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