Issue #3443049 by nicxvan, Arun.k: Remove deprecations in SiteConfigureForm
parent
38d7246949
commit
a879c61681
|
@ -3,11 +3,9 @@
|
|||
namespace Drupal\Core\Installer\Form;
|
||||
|
||||
use Drupal\Core\Datetime\TimeZoneFormHelper;
|
||||
use Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait;
|
||||
use Drupal\Core\Extension\ModuleInstallerInterface;
|
||||
use Drupal\Core\Form\ConfigFormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Locale\CountryManagerInterface;
|
||||
use Drupal\Core\Site\Settings;
|
||||
use Drupal\user\UserInterface;
|
||||
use Drupal\user\UserStorageInterface;
|
||||
|
@ -21,17 +19,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
*/
|
||||
class SiteConfigureForm extends ConfigFormBase {
|
||||
|
||||
use DeprecatedServicePropertyTrait;
|
||||
|
||||
/**
|
||||
* Defines deprecated injected properties.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $deprecatedProperties = [
|
||||
'countryManager' => 'country_manager',
|
||||
];
|
||||
|
||||
/**
|
||||
* The site path.
|
||||
*
|
||||
|
@ -71,7 +58,7 @@ class SiteConfigureForm extends ConfigFormBase {
|
|||
* The user storage.
|
||||
* @param \Drupal\Core\Extension\ModuleInstallerInterface $module_installer
|
||||
* The module installer.
|
||||
* @param \Drupal\Core\Locale\CountryManagerInterface|\Drupal\user\UserNameValidator $userNameValidator
|
||||
* @param \Drupal\user\UserNameValidator $userNameValidator
|
||||
* The user validator.
|
||||
*/
|
||||
public function __construct(
|
||||
|
@ -79,17 +66,12 @@ class SiteConfigureForm extends ConfigFormBase {
|
|||
$site_path,
|
||||
UserStorageInterface $user_storage,
|
||||
ModuleInstallerInterface $module_installer,
|
||||
protected CountryManagerInterface|UserNameValidator $userNameValidator,
|
||||
protected UserNameValidator $userNameValidator,
|
||||
) {
|
||||
$this->root = $root;
|
||||
$this->sitePath = $site_path;
|
||||
$this->userStorage = $user_storage;
|
||||
$this->moduleInstaller = $module_installer;
|
||||
if ($userNameValidator instanceof CountryManagerInterface) {
|
||||
@trigger_error('Calling ' . __METHOD__ . '() with the $userNameValidator argument as CountryManagerInterface is deprecated in drupal:10.3.0 and must be UserNameValidator in drupal:11.0.0. See https://www.drupal.org/node/3431205', E_USER_DEPRECATED);
|
||||
$userNameValidator = \Drupal::service('user.name_validator');
|
||||
}
|
||||
$this->userNameValidator = $userNameValidator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue