You are here

public function AnonymousLoginSubscriber::__construct in Anonymous login 8.2

Same name and namespace in other branches
  1. 8 src/EventSubscriber/AnonymousLoginSubscriber.php \Drupal\anonymous_login\EventSubscriber\AnonymousLoginSubscriber::__construct()

Constructor of a new AnonymousLoginSubscriber.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration object factory.

\Drupal\Core\State\StateInterface $state: The state system.

\Drupal\Core\Session\AccountProxyInterface $current_user: The instantiated account.

\Drupal\Core\Path\PathMatcherInterface $path_matcher: The path matcher.

\Drupal\path_alias\AliasManagerInterface $alias_manager: The path alias manager.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Path\PathValidatorInterface $path_validator: The path validator service.

\Drupal\Core\Path\CurrentPathStack $current_path: The current path.

string $sapi: (Optional) The Server API for this build of PHP. We need it to prevent skipping during tests.

File

src/EventSubscriber/AnonymousLoginSubscriber.php, line 115

Class

AnonymousLoginSubscriber
Class AnonymousLoginSubscriber.

Namespace

Drupal\anonymous_login\EventSubscriber

Code

public function __construct(ConfigFactoryInterface $config_factory, StateInterface $state, AccountProxyInterface $current_user, PathMatcherInterface $path_matcher, AliasManagerInterface $alias_manager, ModuleHandlerInterface $module_handler, PathValidatorInterface $path_validator, CurrentPathStack $current_path, $sapi = PHP_SAPI) {
  $this->configFactory = $config_factory;
  $this->state = $state;
  $this->currentUser = $current_user;
  $this->pathMatcher = $path_matcher;
  $this->aliasManager = $alias_manager;
  $this->moduleHandler = $module_handler;
  $this->pathValidator = $path_validator;
  $this->currentPath = $current_path;
  $this->sapi = $sapi;
}