function CircularDependencyHooks::testHook

Attributes

#[Hook('test_hook')]

File

core/modules/system/tests/modules/HookLoader/hook_loader_test/src/Hook/CircularDependencyHooks.php, line 22

Class

CircularDependencyHooks
Example to test that a hook service can depend on ModuleHandler.

Namespace

Drupal\hook_loader_test\Hook

Code

public function testHook() : string {
  // The hook method does not need to actually use the module handler.
  // It is enough to require it in the constructor.
  return __METHOD__;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.