function HookCollectorPass::addProceduralImplementation
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Hook/HookCollectorPass.php \Drupal\Core\Hook\HookCollectorPass::addProceduralImplementation()
Adds a procedural hook implementation.
Parameters
string $hook: The name of the hook.
string $module: The module implementing the hook, or on behalf of which the hook is implemented.
1 call to HookCollectorPass::addProceduralImplementation()
- HookCollectorPass::collectModuleHookImplementations in core/
lib/ Drupal/ Core/ Hook/ HookCollectorPass.php - Collects procedural and Attribute hook implementations.
File
-
core/
lib/ Drupal/ Core/ Hook/ HookCollectorPass.php, line 513
Class
- HookCollectorPass
- Collects and registers hook implementations.
Namespace
Drupal\Core\HookCode
protected function addProceduralImplementation(string $hook, string $module) : void {
$function = $module . '_' . $hook;
if (in_array($hook, [
'requirements',
'requirements_alter',
])) {
$message = "{$function} without a #[LegacyRequirementsHook] attribute is deprecated in drupal:11.3.0 and removed in drupal:13.0.0. See https://www.drupal.org/node/3549685";
@trigger_error($message, E_USER_DEPRECATED);
}
$this->proceduralImplementations[$hook][] = $module;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.