Change record status: 
Project: 
Introduced in branch: 
12.x
Introduced in version: 
12.1.0
Description: 

The following hooks now have oop replacements.

  • hook_uninstall
  • hook_install
  • hook_update_last_removed
  • hook_schema

If the OOP replacement exists, then the procedural implementation will not run.

There are four new interfaces for replacing this functionality in classes. The interface and the namespace are fixed.
Drupal\Core\Extension\Install\UninstallInterface
Drupal\Core\Extension\Install\InstallInterface
Drupal\Core\Extension\Install\LastRemovedInterface
Drupal\Core\Extension\Install\SchemaInterface

Before
hook_uninstall

After
Implement UninstallInterface in src/Install/Uninstaller

Before
hook_install

After
Implement InstallInterface in src/Install/Installer

Before
hook_update_last_removed

After
Implement LastRemovedInterface in src/Install/LastRemoved

Before
hook_schema

After
Implement SchemaInterface in src/Install/Schema

Impacts: 
Module developers