#2339 - Tidy up hook call pattern

This is a spacer post for a website comment topic. The content this topic relates to: #2339 - Tidy up hook call pattern
Oh, and the new pattern should accommodate for corrupt PHP files, and use the filter_naughty function.
I was thinking whether this is an opportunity to make all the hooks implement a class interface. From a code quality point of view it would be an improvement, with minimal code complexity cost due to it being wrappable inside the new API.

However, I don't like the performance implications. For each hook type we'd need to load up another file that defines the interface, then PHP would need to check interface rules at run-time. That's actually not at all trivial - if you consider a page using 20 hook types, that's 20 extra PHP files loaded. So I think it's best to leave that. It makes more sense for compiled languages.
0 guests and 0 members have recently viewed this.