You are here

public function Cookie::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/user/src/Authentication/Provider/Cookie.php \Drupal\user\Authentication\Provider\Cookie::__construct()

Constructs a new cookie authentication provider.

Parameters

\Drupal\Core\Session\SessionConfigurationInterface $session_configuration: The session configuration.

\Drupal\Core\Database\Connection $connection: The database connection.

\Drupal\Core\Messenger\MessengerInterface|null $messenger: The messenger.

File

core/modules/user/src/Authentication/Provider/Cookie.php, line 58

Class

Cookie
Cookie based authentication provider.

Namespace

Drupal\user\Authentication\Provider

Code

public function __construct(SessionConfigurationInterface $session_configuration, Connection $connection, MessengerInterface $messenger = NULL) {
  $this->sessionConfiguration = $session_configuration;
  $this->connection = $connection;
  $this->messenger = $messenger;
  if ($this->messenger === NULL) {
    @trigger_error('The MessengerInterface must be passed to ' . __NAMESPACE__ . '\\Cookie::__construct(). It was added in drupal:9.2.0 and will be required before drupal:10.0.0.', E_USER_DEPRECATED);
    $this->messenger = \Drupal::messenger();
  }
}