function ModuleHandler::triggerDeprecationError
Triggers an E_USER_DEPRECATED error if any module implements the hook.
Parameters
string $description: Helpful text describing what to do instead of implementing this hook.
string $hook: The name of the hook.
2 calls to ModuleHandler::triggerDeprecationError()
- ModuleHandler::invokeAllDeprecated in core/
lib/ Drupal/ Core/ Extension/ ModuleHandler.php - Invokes a deprecated hook in all enabled modules that implement it.
- ModuleHandler::invokeDeprecated in core/
lib/ Drupal/ Core/ Extension/ ModuleHandler.php - Invokes a deprecated hook in a particular module.
File
-
core/
lib/ Drupal/ Core/ Extension/ ModuleHandler.php, line 426
Class
- ModuleHandler
- Class that manages modules in a Drupal installation.
Namespace
Drupal\Core\ExtensionCode
private function triggerDeprecationError($description, $hook) {
$list = $this->getHookImplementationList($hook);
$modules = array_unique($list->modules);
if (!empty($modules)) {
$message = 'The deprecated hook hook_' . $hook . '() is implemented in these modules: ';
@trigger_error($message . implode(', ', $modules) . '. ' . $description, E_USER_DEPRECATED);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.