You are here

public function JanrainCaptureApi::__construct in Janrain Registration 8

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

File

src/JanrainCaptureApi.php, line 94

Class

JanrainCaptureApi
The integration between Janrain and Drupal.

Namespace

Drupal\janrain_capture

Code

public function __construct(Client $http_client, AccountProxyInterface $current_user, UserDataInterface $user_data, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, KeyValueDatabaseFactory $database_factory, EntityTypeManagerInterface $entity_type_manager, LoggerChannelFactoryInterface $logger_factory) {
  $config = $config_factory
    ->get('janrain_capture.settings')
    ->get('capture');
  $this->clientId = $config['client_id'] ?? '';
  $this->clientSecret = $config['client_secret'] ?? '';
  $this->captureAddress = $config['capture_server'] ?? '';
  $this->logger = $logger_factory
    ->get('janrain_capture');
  $this->userData = $user_data;
  $this->dbStorage = $database_factory
    ->get('janrain_capture');
  $this->httpClient = $http_client;
  $this->userStorage = $entity_type_manager
    ->getStorage('user');
  $this->currentUser = $current_user;
  $this->moduleHandler = $module_handler;
}