Problem/Motivation

Core now has support for OOP hooks. As they are automatically converted into autowired services, it means we can empty out the module file and use proper dependency injection rather than \Drupal::service() calls.

Steps to reproduce

N/A

Proposed resolution

Implement OOP hooks

Remaining tasks

Implement OOP hooks

User interface changes

N/A

API changes

N/A. Procedural hooks will be gone, but hook implementations are not considered API

Data model changes

N/A

Issue fork group-3508876

Command icon 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

kristiaanvandeneynde created an issue. See original summary.

kristiaanvandeneynde’s picture

Should probably kill _group_relation_type_manager() now, but that requires a CR.

kristiaanvandeneynde’s picture

Should go over each hook manually to see if it still works.

Follow-ups:

  • Deprecate _group_relation_type_manager() (v2/3) and remove in v4.
  • Add aliases to our services so they can be autowired (v2/3/4)
kristiaanvandeneynde’s picture

Pushed a commit that uses hook ordering and the new theme initial preprocess callbacks. The entire module file is gone now and I've bumped minimum required version to 11.2. That last bit may make tests fail as we don't have an official 11.2 release yet.

kristiaanvandeneynde’s picture

Tests are failing on me forgetting to convert tokens.inc and views.inc, also need to tackle submodules still.

kristiaanvandeneynde’s picture

All green for next minor, so will commit after one final round of reviewing the code and threads.

kristiaanvandeneynde’s picture

Status: Active » Fixed

Going to commit this in its current shape. Can still make changes before release if the meta in core evolves regarding best practices.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.