This project is not covered by Drupal’s security advisory policy.
This modules allows you to implement Drupal hooks with object-orientated classes, this has a number of benefits:
- Your hooks live in classes, much more inline with Drupal 8
- Your hooks can use dependency injection, great for testing etc.
- You can use a class to organise your code rather than having monster size hooks or global functions that are only used as hook helpers.
- The overhead of running this module is nearly zero on normal pages, it will add a few hundred milliseconds to a cache clear though.
Currently this module only supports alter hooks although i'm discussing approaches to support invoke() and invokeAll() - https://www.drupal.org/node/2595769
Do not use this module in production yet, the architecture is not finalised.
Current Usage
Events - Create an event subscribe called "hooks.$your_hook_name" , you will receive an instance of HookEvent.
Implicit - Currently commented out in our ModulerHandler override, allows you to simply put the class in the right location to work. Likely to be removed in #2611020: Remove implicit style hooks
Project information
- Seeking new maintainer
The current maintainers are looking for new people to take ownership. - Module categories: Developer Tools
- 2 sites report using this module
- Created by benjy on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.