Problem/Motivation
Implement OOP hooks for better OOP & DI support, instead of having all hook logic in the module file.
Proposed resolution
Convert hook implementations to OOP hooks, with backwards compatibility.
See https://www.drupal.org/node/3442349
Remaining tasks
- Define hooks that can be converted into OOP hooks
- Create hook clas(ses) to logically bundle relevant hooks with their logic
- Add backwards compatibility support
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork lazy_iframe-3547855
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ankitv18 commentedComment #3
ritarshi_chakraborty commentedWorking on it.
Comment #5
ritarshi_chakraborty commentedPlease review my MR.
Comment #6
danrodHey @ritarshi_chakraborty I'm editing some of your changes, because as far as I know, the hook_preprocess functions remain procedural: https://www.drupal.org/node/3442349
Comment #7
danrodComment #8
danrodTested this on a D10.5.4 instance, I'll move it to RTBC.
Comment #9
danrodComment #11
danrodMerged, thanks a lot to everyone involved.
Comment #12
danrodComment #14
ritarshi_chakraborty commentedHey @danrod, thanks for the heads-up! Always pleased to contribute and learn from the process. Appreciate the feedback!