Page MenuHomePhabricator

Inject services used by LinkBatch
Closed, ResolvedPublic

Description

LinkBatch currently uses several services directly by calling the service locator.
This makes testing code using LinkBatch complex, requiring the usage of integration tests that call setService.
LinkBatch should instead have all required services (LinkCache, TitleFormatter, ContentLanguage, GenderCache and LoadBalancer) injected instead, by making construction through a factory service mandatory.

For compatibility, the constructor should make all services optional, falling back to calling the service locator in the constructor when the services are not provided.

Event Timeline

Change 544296 had a related patch set uploaded (by Mainframe98; owner: Mainframe98):
[mediawiki/core@master] Add LinkBatchFactory to inject services into LinkBatch

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

Change 544296 merged by jenkins-bot:
[mediawiki/core@master] Add LinkBatchFactory to inject services into LinkBatch

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

Mainframe98 closed this task as Resolved.Jan 6 2020, 6:13 PM