Page MenuHomePhabricator

[ES-M5] Refactor `onTitleGetRestrictionTypes` hook handler to use hook interfaces and Dependency Injection
Closed, ResolvedPublic3 Estimated Story Points

Description

Currently, the registered onTitleGetRestrictionTypes hook handler is registered through a static method of the EntitySchemaHooks class. However, as this class depends on some MediaWiki services, it could leverage from the new MediaWiki dependency injection system.

To improve the analyzability and testability of this hook handler, we should refactor this static handler to a class that implements the TitleGetRestrictionTypesHook interface and has its dependencies injected via constructor.

Acceptance Criteria:

  • The hook handler function is moved to a class that implements the TitleGetRestrictionTypesHook interface and injects its dependent services
  • The hook handler's registration in extension.json declares its service dependencies for dependency injection

Event Timeline

Prio Notes

  • Impact Areas: Analyzability, Testability
  • Does not affect end users / production
  • Does not affect monitoring efforts
  • Does not affect development efforts
  • Affects onboarding efforts
  • Does not affect additional stakeholders

Change 938216 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[mediawiki/extensions/EntitySchema@master] Refactor `onTitleGetRestrictionTypes` hook handler to use hook interfaces

https://gerrit.wikimedia.org/r/938216

Change 938216 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Refactor `onTitleGetRestrictionTypes` hook handler to use hook interfaces

https://gerrit.wikimedia.org/r/938216

Looks good, thank you!