You are here

public function PathSubscriber::__construct in Drupal 8

Constructs a new PathSubscriber instance.

Parameters

\Drupal\Core\Path\AliasManagerInterface $alias_manager: The alias manager.

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

File

core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php, line 44

Class

PathSubscriber
Provides a path subscriber that converts path aliases.

Namespace

Drupal\Core\EventSubscriber

Code

public function __construct(AliasManagerInterface $alias_manager, CurrentPathStack $current_path) {
  $this->aliasManager = $alias_manager;
  $this->currentPath = $current_path;

  // This is used as base class by the new class, so we do not trigger
  // deprecation notices when that or any child class is instantiated.
  $new_class = 'Drupal\\path_alias\\EventSubscriber\\PathAliasSubscriber';
  if (!is_a($this, $new_class) && class_exists($new_class)) {
    @trigger_error('The \\' . __CLASS__ . ' class is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use \\' . $new_class . '. See https://drupal.org/node/3092086', E_USER_DEPRECATED);
  }
}