Use service 'GadgetsRepo' instead of deprecated GadgetRepo::singleton()

Change-Id: I226b259e361d3d27ec89975353fdf6396ba60ccb
This commit is contained in:
Fomafix 2024-06-30 09:00:43 +00:00
parent 1a2ccbb58c
commit f6c3c98bc3

View file

@ -17,7 +17,6 @@ use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\DiscussionTools\CommentParser;
use MediaWiki\Extension\DiscussionTools\CommentUtils;
use MediaWiki\Extension\DiscussionTools\ContentThreadItemSet;
use MediaWiki\Extension\Gadgets\GadgetRepo;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
use MediaWiki\Output\OutputPage;
@ -199,7 +198,7 @@ class HookUtils {
$extensionRegistry = ExtensionRegistry::getInstance();
if ( $extensionRegistry->isLoaded( 'Gadgets' ) ) {
$gadgetsRepo = GadgetRepo::singleton();
$gadgetsRepo = MediaWikiServices::getInstance()->getService( 'GadgetsRepo' );
$match = array_search( $gadgetName, $gadgetsRepo->getGadgetIds(), true );
if ( $match !== false ) {
try {