- 🇨🇭Switzerland berdir Switzerland
Related issues: ✨ hook_event_dispatcher compatability Active and 📌 Support CronSubscribers Active (and the related core issue).
Interesting solution but it's trying to be a little bit too generic I think. Whether or not something is/has certain hook is just a naming convention, with that logic, any module-prefixed callback is going to be recognized as a hook.
Instead, we should do this only if it the cron hook. Meaning, isCallbackHook() should just check $this->getHookName() === 'cron', at this point we can of need to expect that it exists.
Hopefully, the long-term solution is the core issue that I created to make cron tasks/jobs their own thing that can be discovered and not hooks. Feedback/reviews there would definitely be welcome.