Currently, UserCache is retrieved through UserCache::singleton, and the actual constructor is protected. Within the class, it uses a debugger (currently via wfDebug), a load balancer (currently retrieves a database via wfGetDB) and a LinkBatch object.
I propose that this be converted to a service:
- A \Psr\Log\LoggerInterface is injected
- A Wikimedia\Rdbms\ILoadBalancer is injected
- A MediaWiki\Cache\LinkBatchFactory is injected
The singleton method can be deprecated, and since the constructor isn't public there is no need for backwards compatibility with the current signature (no params at all). Codesearch reports that nothing currently extends the class