Page MenuHomePhabricator

Convert Utilities.php (previously TranslateUtils.php) into a service.
Open, LowPublic

Description

As part of work done in T313242 and follow-up on the conversation on this patch, we would like to update Utilities.php to a Service that is also testable.

  • "Utilities.php has several calls to MediaWikiServices::getInstance() and hardly any tests. These both indicate that it should probably be a dependency-injected service instead of a static class." ~ @Tacsipacsi
  • "Maybe some of the things could be split out from the utilities, to another existing class or as a separate service. " ~ @Nikerabbit

Event Timeline

Since all references need to be updated anyway, now is a good time to do this.

This is exactly the reason why this should not be split out of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/865574. If you decide to split it out regardless, at least don’t copy my arguments that don’t make sense here. (P.S. I would’ve appreciated if you quoted me instead of copying my comment without attribution, so that others know which point was made by whom.)

In T326714#8516116, @Tacsipacsi wrote:
(P.S. I would’ve appreciated if you quoted me instead of copying my comment without attribution, so that others know which point was made by whom.)

Sorry about that, that was an oversight. I've updated the description.