Skip to content
Snippets Groups Projects
Commit 9e6b122e authored by Seth Hill's avatar Seth Hill Committed by Matthijs Van Assche
Browse files

Resolve #3503356 "Fatal error when"

parent a2387fe4
No related branches found
No related tags found
1 merge request!12Resolve #3503356 "Fatal error when"
......@@ -8,6 +8,7 @@ use Drupal\Component\Uuid\UuidInterface;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
......@@ -90,6 +91,8 @@ class RealmsConfigForm extends ConfigFormBase {
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory service.
* @param Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager.
* @param \Drupal\oidc\OpenidConnectRealm\OpenidConnectRealmManager $realm_manager
* The OpenID Connect realm manager.
* @param \Drupal\externalauth\AuthmapInterface $authmap
......@@ -107,8 +110,8 @@ class RealmsConfigForm extends ConfigFormBase {
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, OpenidConnectRealmManager $realm_manager, AuthmapInterface $authmap, UuidInterface $uuid, KeyValueFactoryInterface $key_value_factory, JsonHttpClientInterface $json_http_client, TimeInterface $time, LoggerInterface $logger, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config_manager, OpenidConnectRealmManager $realm_manager, AuthmapInterface $authmap, UuidInterface $uuid, KeyValueFactoryInterface $key_value_factory, JsonHttpClientInterface $json_http_client, TimeInterface $time, LoggerInterface $logger, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($config_factory, $typed_config_manager);
$this->realmManager = $realm_manager;
$this->authmap = $authmap;
......@@ -126,6 +129,7 @@ class RealmsConfigForm extends ConfigFormBase {
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('config.typed'),
$container->get('plugin.manager.openid_connect_realm'),
$container->get('externalauth.authmap'),
$container->get('uuid'),
......
......@@ -3,6 +3,7 @@
namespace Drupal\oidc\Form;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteBuilderInterface;
......@@ -41,13 +42,15 @@ class SettingsForm extends ConfigFormBase {
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager.
* @param \Drupal\Core\Routing\RouteBuilderInterface $route_builder
* The route builder service.
* @param \Drupal\oidc\OpenidConnectRealm\OpenidConnectRealmManagerInterface $realm_manager
* The OpenID Connect realm manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, RouteBuilderInterface $route_builder, OpenidConnectRealmManagerInterface $realm_manager) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config_manager, RouteBuilderInterface $route_builder, OpenidConnectRealmManagerInterface $realm_manager) {
parent::__construct($config_factory, $typed_config_manager);
$this->realmManager = $realm_manager;
$this->routeBuilder = $route_builder;
......@@ -59,6 +62,7 @@ class SettingsForm extends ConfigFormBase {
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('config.typed'),
$container->get('router.builder'),
$container->get('plugin.manager.openid_connect_realm')
);
......
......@@ -35,7 +35,7 @@ class DisplayNameFieldItemList extends FieldItemList {
/**
* {@inheritdoc}
*/
public function getIterator() {
public function getIterator(): \ArrayIterator {
$this->ensureCalculated();
return parent::getIterator();
......
......@@ -12,7 +12,7 @@ class UserMailUnique extends UserUserMailUnique {
/**
* {@inheritdoc}
*/
public function validatedBy() {
public function validatedBy(): string {
return UserMailUniqueValidator::class;
}
......
......@@ -47,7 +47,7 @@ class UserMailUniqueValidator extends UniqueFieldValueValidator implements Conta
/**
* {@inheritdoc}
*/
public function validate($items, Constraint $constraint) {
public function validate($items, Constraint $constraint): void {
/** @var \Drupal\user\UserInterface $user */
$user = $items->getEntity();
......
......@@ -32,7 +32,7 @@ class ImmutableTrustedRedirectResponse extends TrustedRedirectResponse {
* {@inheritdoc}
*/
public function setTargetUrl($url): static {
if ($this->targetUrl === NULL || $this->targetUrl === $url) {
if (empty($this->targetUrl) || $this->targetUrl === $url) {
parent::setTargetUrl($url);
}
......@@ -43,7 +43,7 @@ class ImmutableTrustedRedirectResponse extends TrustedRedirectResponse {
* {@inheritdoc}
*/
public function setTrustedTargetUrl($url) {
if ($this->targetUrl === NULL || $this->targetUrl === $url) {
if (empty($this->targetUrl) || $this->targetUrl === $url) {
parent::setTrustedTargetUrl($url);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment