As of today, for plugins, listening to hooks is tedious, there is a lot of copy/paste and things are scattered at different places:
- Usage of hooks must be declared in
getHooksAndCallbacks
- It's not easy to find the hook that correspond to a callback
- There is a lot of repetition of the event: at hook declaration (
getHooksAndCallbacks
), at the name of the callback, at the first parameter name.
Using attributes, we can greatly simplify that.