Problem/Motivation

There are only a few remaining procedural hooks.
Four of them are called from ModuleInstaller.

Let's provide class replacements similar to #3623380: Create OOP replacement for hook_install_tasks and hook_install_tasks_alter

  • hook_uninstall
  • hook_install
  • hook_update_last_removed
  • hook_schema

Steps to reproduce

Open module installer.

Proposed resolution

Create interfaces for the four hooks.
Call the hooks and fallback to procedural.

Remaining tasks

What do we call these former hooks?
Review
Add follow up for conversion
Add deprecation follow up for the procedural fall back@trigger_error("Procedural hook_{$hook}() is deprecated in drupal:12.1.0 and is removed from drupal:13.0.0. Use the class replacements instead. See https://www.drupal.org/node/3633696', E_USER_DEPRECATED);

User interface changes

Introduced terminology

API changes

  • hook_uninstall is replaced by UninstallInterface
  • hook_install is replaced by InstallInterface
  • hook_update_last_removed is replaced by LastRemovedInterface
  • hook_schemais replaced by SchemaInterface

Data model changes

Release notes snippet

Issue fork drupal-3633695

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

nicxvan created an issue. See original summary.

nicxvan changed the visibility of the branch 3633695-provide-class-replacements to hidden.

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

I think we need to come up with a new name for these after adding these will have 7.

nicxvan’s picture

Issue summary: View changes
Status: Active » Needs review

The failures are random, they pass locally.

This should be ready for review!

nicxvan’s picture

Status: Needs review » Needs work

Documentation needs updates.

nicxvan’s picture

Status: Needs work » Needs review

I updated the comments, this should be ready.