task: #3594544 Convert the hooks to the object-oriented pattern with legacy support

Issue: https://www.drupal.org/project/ace_editor/issues/3594544

Rebuilt the Project Update Bot's automated conversion (!25 (closed)) into a complete one:

  • All procedural logic moved out of ace_editor.module: the new AceEditorLibraries service owns library discovery, hook_library_info_build() and hook_library_info_alter() (with injected file_system, extension lists and config factory, and per-request caching of the resolved path), and src/Hook/AceEditorHooks.php carries the #[Hook] implementations. The bot converted only hook_help().
  • #[LegacyHook] wrappers stay in the .module file, so older cores and any caller of ace_editor_lib_path() keep working.
  • Kept the bot's RequirementSeverity / DeprecationHelper handling and applied the same treatment to the REQUIREMENT_ERROR branch it missed.
  • Fixed a latent bug along the way: library_info_build() and library_info_alter() used the discovered path without checking discovery succeeded, so a site without the Ace library got scanDirectory(DRUPAL_ROOT . FALSE) and bogus asset paths. They now degrade cleanly.
  • #[Group] attributes added to the existing test classes (PHPUnit 12 drops annotation-only groups).

Tests: new AceEditorLibrariesTest (services wired, discovery without the library, both library hooks, help text). Verified locally: kernel+unit suite 19 tests / 35 assertions green, PHPStan clean, PHPCS clean, the full local pipeline green (cspell, eslint, MkDocs, 12/12 functional scenarios), and the module installed on a fresh Drupal 11.4.5 site where the service resolves the library correctly.

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release
Edited by Rajab Natshah

Merge request reports

Loading