From a7309d2b1fcc92d9e481b13030da8966888c4dfb Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Mon, 30 Oct 2023 21:06:33 +0530 Subject: [PATCH] Namespace special page classes Change-Id: I005f6674c9cc80c5c9e26ae84acfbceebb43734e --- extension.json | 4 ++-- includes/Hooks.php | 3 ++- includes/{ => Special}/SpecialGadgetUsage.php | 3 ++- includes/{ => Special}/SpecialGadgets.php | 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-) rename includes/{ => Special}/SpecialGadgetUsage.php (98%) rename includes/{ => Special}/SpecialGadgets.php (98%) diff --git a/extension.json b/extension.json index f2db751e..7a517095 100644 --- a/extension.json +++ b/extension.json @@ -46,8 +46,8 @@ "gadgets-definition-edit" ], "SpecialPages": { - "Gadgets": "MediaWiki\\Extension\\Gadgets\\SpecialGadgets", - "GadgetUsage": "MediaWiki\\Extension\\Gadgets\\SpecialGadgetUsage" + "Gadgets": "MediaWiki\\Extension\\Gadgets\\Special\\SpecialGadgets", + "GadgetUsage": "MediaWiki\\Extension\\Gadgets\\Special\\SpecialGadgetUsage" }, "APIListModules": { "gadgetcategories": "MediaWiki\\Extension\\Gadgets\\Api\\ApiQueryGadgetCategories", diff --git a/includes/Hooks.php b/includes/Hooks.php index a8e64898..7741386a 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -31,6 +31,7 @@ use IContextSource; use InvalidArgumentException; use ManualLogEntry; use MediaWiki\Extension\Gadgets\Content\GadgetDefinitionContent; +use MediaWiki\Extension\Gadgets\Special\SpecialGadgetUsage; use MediaWiki\Hook\BeforePageDisplayHook; use MediaWiki\Hook\DeleteUnknownPreferencesHook; use MediaWiki\Hook\EditFilterMergedContentHook; @@ -420,7 +421,7 @@ class Hooks implements * @param array &$queryPages */ public function onWgQueryPages( &$queryPages ) { - $queryPages[] = [ 'SpecialGadgetUsage', 'GadgetUsage' ]; + $queryPages[] = [ SpecialGadgetUsage::class, 'GadgetUsage' ]; } /** diff --git a/includes/SpecialGadgetUsage.php b/includes/Special/SpecialGadgetUsage.php similarity index 98% rename from includes/SpecialGadgetUsage.php rename to includes/Special/SpecialGadgetUsage.php index 2543c14f..5d889cf1 100644 --- a/includes/SpecialGadgetUsage.php +++ b/includes/Special/SpecialGadgetUsage.php @@ -24,9 +24,10 @@ * @author Niharika Kohli */ -namespace MediaWiki\Extension\Gadgets; +namespace MediaWiki\Extension\Gadgets\Special; use Html; +use MediaWiki\Extension\Gadgets\GadgetRepo; use OutputPage; use QueryPage; use Skin; diff --git a/includes/SpecialGadgets.php b/includes/Special/SpecialGadgets.php similarity index 98% rename from includes/SpecialGadgets.php rename to includes/Special/SpecialGadgets.php index 0b55165a..da77b3d3 100644 --- a/includes/SpecialGadgets.php +++ b/includes/Special/SpecialGadgets.php @@ -9,11 +9,13 @@ * @license GPL-2.0-or-later */ -namespace MediaWiki\Extension\Gadgets; +namespace MediaWiki\Extension\Gadgets\Special; use Html; use HTMLForm; use InvalidArgumentException; +use MediaWiki\Extension\Gadgets\Gadget; +use MediaWiki\Extension\Gadgets\GadgetRepo; use MediaWiki\MediaWikiServices; use MediaWiki\Title\Title; use Sanitizer;