drupal.org
Handle module preprocess functions as OOP hooks
Problem/Motivation hook_preprocess and hook_preprocess_HOOK functions are still required to be in a .module/.inc file. Steps to reproduce N/A Proposed resolution Gather the preprocess hooks in the HookCollectorPass. Then store theme suggestions in a container parameter. Cache the prefix and the hook separately in an invoke map like this: ['module' => $prefix, 'hook' => 'preprocess_'.