You are here

public function OpenIDConnectClientBase::__construct in OpenID Connect / OAuth client 8

Same name and namespace in other branches
  1. 2.x src/Plugin/OpenIDConnectClientBase.php \Drupal\openid_connect\Plugin\OpenIDConnectClientBase::__construct()

The constructor.

Parameters

array $configuration: The plugin configuration.

string $plugin_id: The plugin identifier.

mixed $plugin_definition: The plugin definition.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\GuzzleHttp\ClientInterface $http_client: The http client.

\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory: The logger factory.

\Drupal\Component\Datetime\TimeInterface $datetime_time: The datetime.time service.

\Drupal\Core\PageCache\ResponsePolicy\KillSwitch $page_cache_kill_switch: Policy evaluating to static::DENY when the kill switch was triggered.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\openid_connect\OpenIDConnectStateTokenInterface $state_token: The OpenID state token service.

Overrides PluginBase::__construct

File

src/Plugin/OpenIDConnectClientBase.php, line 112

Class

OpenIDConnectClientBase
Base class for OpenID Connect client plugins.

Namespace

Drupal\openid_connect\Plugin

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, RequestStack $request_stack, ClientInterface $http_client, LoggerChannelFactoryInterface $logger_factory, TimeInterface $datetime_time = NULL, KillSwitch $page_cache_kill_switch = NULL, LanguageManagerInterface $language_manager = NULL, OpenIDConnectStateTokenInterface $state_token = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->requestStack = $request_stack;
  $this->httpClient = $http_client;
  $this->loggerFactory = $logger_factory;
  $this->dateTime = $datetime_time ?: \Drupal::time();
  $this->pageCacheKillSwitch = $page_cache_kill_switch ?: \Drupal::service('page_cache_kill_switch');
  $this->languageManager = $language_manager ?: \Drupal::languageManager();
  $this->stateToken = $state_token ?: \Drupal::service('openid_connect.state_token');
  $this
    ->setConfiguration($configuration);
}