- Issue created by @joachim
- First commit to issue fork.
- Merge request !11764Issue #3517423: refactor HookCollectorPass::checkForProceduralOnlyHooks() so... → (Open) created by annmarysruthy
- 🇮🇳India annmarysruthy
I've raised an MR!11764 implementing the suggested solution for this issue. The PR refactors the HookCollectorPass::checkForProceduralOnlyHooks() method to make it more reusable by other components.
Kindly review.
- 🇬🇧United Kingdom joachim
Oh wait, the hook attribute takes a short hook name:
> #[Hook('field_type_category_info_alter')]
which means the method probably does too.
We should document it's the short hook name, without the 'hook_' prefix -- see the docs on the Hook attribute class for an example.
- 🇮🇳India annmarysruthy
@joachim made changes as per review comment. Kindly review
- 🇺🇸United States nicxvan
Can you share an example where you're trying to use this?
- 🇬🇧United Kingdom joachim
Drupal Code Builder could call it to check which hooks can be generated as class methods and which must be procedural.
Also, API module could use it to automatically document that about hooks.
- 🇺🇸United States nicxvan
Yeah I meant more of a concrete example, I mean it really feels like overkill to load HCP for just this one bit.
Still not ready to pull this out of RTBC, but it feels like the wrong place for this.
- 🇺🇸United States nicxvan
I'd like to request this be postponed on 📌 Hook ordering across OOP, procedural and with extra types Active
This has technically been RTBC longer, but this is trivial to rebase compared to the other issue. I do still have some questions about how to provide this list.