You are here

public function Redirect404Subscriber::__construct in Redirect 8

Constructs a new Redirect404Subscriber.

Parameters

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

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

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

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

\Drupal\redirect_404\RedirectNotFoundStorageInterface $redirect_storage: A redirect storage.

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

File

modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php, line 79

Class

Redirect404Subscriber
An EventSubscriber that listens to redirect 404 errors.

Namespace

Drupal\redirect_404\EventSubscriber

Code

public function __construct(CurrentPathStack $current_path, PathMatcherInterface $path_matcher, RequestStack $request_stack, LanguageManagerInterface $language_manager, RedirectNotFoundStorageInterface $redirect_storage, ConfigFactoryInterface $config) {
  $this->currentPath = $current_path;
  $this->pathMatcher = $path_matcher;
  $this->requestStack = $request_stack;
  $this->languageManager = $language_manager;
  $this->redirectStorage = $redirect_storage;
  $this->config = $config
    ->get('redirect_404.settings');
}