- π«π·France andypost
Removed
field_hook_info()
from IS as it was moved toviews_hook_info()
in #2399931: Generic entity api field handler should live in views module not in field module βSo only tokens and views using this hook but it needs to deprecate
\Drupal\Core\Extension\ModuleHandlerInterface::getHookInfo()
as wellFiled follow-up to remove broken ref π Remove stray reference to field_hook_info() Fixed
- π«π·France andypost
Closed as duplicates
- π [meta] Core does not use hook_hook_info() Closed: duplicate
- β¨ Stop using magic functions and force modules to declare the hooks they want to implement Closed: duplicate
- β¨ Let hook_hook_info() handle hooks in .install files (aka "rename MODULE.install to MODULE.install.inc") Closed: duplicate - π¬π§United Kingdom catch
If we replace hooks completely, fine. But we are not there yet I think.
Until then, something like hook_hook_info() is useful for code organization, similar to autoloading for classes (not autoloading itself, but the PSR-4 file organization that is made necessary by autoloading).Just to answer #19 - a lot of modules and some of core too already puts the logic of their hook implementations into classes, so that the hook implementation in .module is just three lines or so. This pattern is available for every hook, not just the ones that have hook_hook_info() implemented for them.