function AccountSettingsForm::__construct

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

Constructs a \Drupal\system\ConfigFormBase object.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The factory for configuration objects.

\Drupal\Core\Config\TypedConfigManagerInterface $typedConfigManager: The typed config manager.

Overrides ConfigFormBase::__construct

File

core/modules/user/src/AccountSettingsForm.php, line 35

Class

AccountSettingsForm
Configure user settings for this site.

Namespace

Drupal\user

Code

public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typedConfigManager, RoleStorageInterface|ModuleHandlerInterface $role_storage, protected ?AccountCancellation $accountCancellation = NULL) {
  parent::__construct($config_factory, $typedConfigManager);
  $this->roleStorage = $role_storage;
  if ($role_storage instanceof ModuleHandlerInterface) {
    $this->moduleHandler = $role_storage;
    $this->roleStorage = func_get_arg(3);
    @trigger_error('Calling ' . __METHOD__ . '() with the $module_handler argument is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. See https://www.drupal.org/node/3566911', E_USER_DEPRECATED);
  }
  if ($accountCancellation === NULL) {
    @trigger_error('Calling ' . __METHOD__ . '() without the $accountCancellation argument is deprecated in drupal:11.5.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/node/3620934', E_USER_DEPRECATED);
    $accountCancellation = \Drupal::service(AccountCancellation::class);
  }
  $this->accountCancellation = $accountCancellation;
}

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