function TestHookReorderHookFirst::customHookOverride
This pair tests ReorderHook.
Attributes
#[Hook('custom_hook_override')]
#[ReorderHook('custom_hook_override', class: TestHookReorderHookLast::class, method: 'customHookOverride', order: new OrderAfter(classesAndMethods: [
[
TestHookReorderHookFirst::class,
'customHookOverride',
],
]))]
File
-
core/
modules/ system/ tests/ modules/ HookCollector/ aaa_hook_collector_test/ src/ Hook/ TestHookReorderHookFirst.php, line 24
Class
- TestHookReorderHookFirst
- This class contains hook implementations.
Namespace
Drupal\aaa_hook_collector_test\HookCode
public function customHookOverride() : string {
// This normally would run first.
// We override that order in hook_order_second_alphabetically.
// We override, that order here with ReorderHook.
return __METHOD__;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.