Problem/Motivation
one_time_password.modulestill contains four procedural hook implementations, each tagged#[LegacyHook]and forwarding to an equivalent method already implemented insrc/Hook/OneTimePasswordHooks.php.#[LegacyHook]only exists to support Drupal core versions older than 11.1.0, where attribute-based hooks aren't available.- The module's
core_version_requirementis^11.3 || ^12, so no supported version of core will ever execute these procedural fallbacks, making them dead code. - Separately,
one_time_password.installimplementshook_requirements()procedurally, but only ever returns data for theruntimephase.
Steps to reproduce
Proposed resolution
- The
one_time_password.modulefile will be deleted, since it will contain no remaining logic once the legacy stubs are removed. hook_requirements()will be replaced with an OOP#[Hook('runtime_requirements')]implementation onOneTimePasswordHooks, dropping the now-unnecessary$phasecheck.hook_install()will remain procedural inone_time_password.install, as Drupal core does not support class-based/attribute implementations of install-time hooks.- The kernel test covering requirements will be updated to invoke the hook via
\Drupal::moduleHandler()->invoke()instead of calling the removed procedural function directly.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork one_time_password-3614187
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 #4
kim.pepperCommitted to 2.x