You are here

public function UserSyncEventSubscriber::__construct in SAML Authentication 4.x

Same name and namespace in other branches
  1. 8.3 src/EventSubscriber/UserSyncEventSubscriber.php \Drupal\samlauth\EventSubscriber\UserSyncEventSubscriber::__construct()
  2. 8.2 src/EventSubscriber/UserSyncEventSubscriber.php \Drupal\samlauth\EventSubscriber\UserSyncEventSubscriber::__construct()

Constructs a new SamlauthUserSyncSubscriber.

Parameters

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

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The EntityTypeManager service.

\Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager: The typed data manager.

\Drupal\Component\Utility\EmailValidatorInterface $email_validator: The email validator. Note the code defines it as \Egulias\EmailValidator\EmailValidator for the time being; reason:

We already typehint the interface in comments, otherwise the call to isValid() will appear to contain errors. But we don't want to mandate Core >= 8.7 just yet, so the 'use' statement is still not updated.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

\Drupal\Core\StringTranslation\TranslationInterface $translation: The string translation service.

File

src/EventSubscriber/UserSyncEventSubscriber.php, line 102

Class

UserSyncEventSubscriber
Event subscriber that synchronizes user properties on a user_sync event.

Namespace

Drupal\samlauth\EventSubscriber

Code

public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, TypedDataManagerInterface $typed_data_manager, EmailValidator $email_validator, LoggerInterface $logger, MessengerInterface $messenger, TranslationInterface $translation) {
  $this->entityTypeManager = $entity_type_manager;
  $this->emailValidator = $email_validator;
  $this->logger = $logger;
  $this->typedDataManager = $typed_data_manager;
  $this->config = $config_factory
    ->get('samlauth.authentication');
  $this
    ->setStringTranslation($translation);
}