Issue #3275216 by akoepke, larowlan: Fix UpdateSettingsForm dependency injection
parent
30e4e1cb0e
commit
e07302510f
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
namespace Drupal\update;
|
namespace Drupal\update;
|
||||||
|
|
||||||
|
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||||
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
|
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
|
||||||
use Drupal\Core\Url;
|
use Drupal\Core\Url;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Drupal\Core\Form\ConfigFormBase;
|
use Drupal\Core\Form\ConfigFormBase;
|
||||||
use Drupal\Core\Form\FormStateInterface;
|
use Drupal\Core\Form\FormStateInterface;
|
||||||
|
use Drupal\Component\Utility\EmailValidatorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure update settings for this site.
|
* Configure update settings for this site.
|
||||||
|
@ -22,13 +24,27 @@ class UpdateSettingsForm extends ConfigFormBase implements ContainerInjectionInt
|
||||||
*/
|
*/
|
||||||
protected $emailValidator;
|
protected $emailValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an UpdateSettingsForm object.
|
||||||
|
*
|
||||||
|
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
|
||||||
|
* The factory for configuration objects.
|
||||||
|
* @param \Drupal\Component\Utility\EmailValidatorInterface $email_validator
|
||||||
|
* The email validator.
|
||||||
|
*/
|
||||||
|
public function __construct(ConfigFactoryInterface $config_factory, EmailValidatorInterface $email_validator) {
|
||||||
|
parent::__construct($config_factory);
|
||||||
|
$this->emailValidator = $email_validator;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static function create(ContainerInterface $container) {
|
public static function create(ContainerInterface $container) {
|
||||||
$instance = parent::create($container);
|
return new static(
|
||||||
$instance->emailValidator = $container->get('email.validator');
|
$container->get('config.factory'),
|
||||||
return $instance;
|
$container->get('email.validator')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue