You are here

public function HookDiscovery::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php \Drupal\Core\Plugin\Discovery\HookDiscovery::__construct()
  2. 9 core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php \Drupal\Core\Plugin\Discovery\HookDiscovery::__construct()

Constructs a Drupal\Core\Plugin\Discovery\HookDiscovery object.

Parameters

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

string $hook: The Drupal hook that a module can implement in order to interface to this discovery class.

File

core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php, line 39

Class

HookDiscovery
Provides a hook-based plugin discovery class.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function __construct(ModuleHandlerInterface $module_handler, $hook) {
  $this->moduleHandler = $module_handler;
  $this->hook = $hook;
}