From 049a7471436cdc3d133207c341f629973de8add6 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 9 Jun 2024 18:48:28 +0200 Subject: [PATCH] Use namespaced classes Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Ifcc9113bc1d2cf79d21871abe7652d7ed8dde20a --- src/HookHandlers/ParserHooksHandler.php | 2 +- src/HookHandlers/SchemaHooksHandler.php | 2 +- src/Hooks.php | 2 +- src/Hooks/HookRunner.php | 2 +- src/Hooks/MathFormulaPostRenderHook.php | 2 +- src/InputCheck/BaseChecker.php | 2 +- src/InputCheck/LocalChecker.php | 2 +- src/InputCheck/MathoidChecker.php | 2 +- src/InputCheck/RestbaseChecker.php | 2 +- src/MathConfig.php | 2 +- src/MathRenderer.php | 6 +++--- src/SpecialMathWikibase.php | 2 +- src/Widget/MathTestInputForm.php | 2 +- tests/phpunit/InputCheck/InputCheckFactoryTest.php | 2 +- tests/phpunit/InputCheck/LocalCheckerTest.php | 2 +- tests/phpunit/InputCheck/RestbaseCheckerTest.php | 1 + tests/phpunit/MathMathMLTest.php | 1 + tests/phpunit/integration/PreferencesIntegrationTest.php | 2 +- tests/wfTest.php | 1 + 19 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/HookHandlers/ParserHooksHandler.php b/src/HookHandlers/ParserHooksHandler.php index 69b54b24c..dd3c0a70d 100644 --- a/src/HookHandlers/ParserHooksHandler.php +++ b/src/HookHandlers/ParserHooksHandler.php @@ -13,8 +13,8 @@ use MediaWiki\Hook\ParserFirstCallInitHook; use MediaWiki\Hook\ParserOptionsRegisterHook; use MediaWiki\HookContainer\HookContainer; use MediaWiki\Logger\LoggerFactory; +use MediaWiki\Parser\Parser; use MediaWiki\User\Options\UserOptionsLookup; -use Parser; use ParserOptions; /** diff --git a/src/HookHandlers/SchemaHooksHandler.php b/src/HookHandlers/SchemaHooksHandler.php index 11b96d6f0..cf748ab84 100644 --- a/src/HookHandlers/SchemaHooksHandler.php +++ b/src/HookHandlers/SchemaHooksHandler.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\Math\HookHandlers; -use DatabaseUpdater; +use MediaWiki\Installer\DatabaseUpdater; use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; /** diff --git a/src/Hooks.php b/src/Hooks.php index db7fab63d..8da9a60e6 100644 --- a/src/Hooks.php +++ b/src/Hooks.php @@ -13,11 +13,11 @@ namespace MediaWiki\Extension\Math; use ExtensionRegistry; use Maintenance; use MediaWiki\Config\ConfigException; +use MediaWiki\Context\RequestContext; use MediaWiki\Hook\MaintenanceRefreshLinksInitHook; use MediaWiki\MediaWikiServices; use MediaWiki\Settings\SettingsBuilder; use MediaWiki\SpecialPage\Hook\SpecialPage_initListHook; -use RequestContext; class Hooks implements SpecialPage_initListHook, diff --git a/src/Hooks/HookRunner.php b/src/Hooks/HookRunner.php index 7a5355599..733293b0e 100644 --- a/src/Hooks/HookRunner.php +++ b/src/Hooks/HookRunner.php @@ -4,7 +4,7 @@ namespace MediaWiki\Extension\Math\Hooks; use MediaWiki\Extension\Math\MathRenderer; use MediaWiki\HookContainer\HookContainer; -use Parser; +use MediaWiki\Parser\Parser; use stdClass; /** diff --git a/src/Hooks/MathFormulaPostRenderHook.php b/src/Hooks/MathFormulaPostRenderHook.php index 9a6a50860..f09791c43 100644 --- a/src/Hooks/MathFormulaPostRenderHook.php +++ b/src/Hooks/MathFormulaPostRenderHook.php @@ -3,7 +3,7 @@ namespace MediaWiki\Extension\Math\Hooks; use MediaWiki\Extension\Math\MathRenderer; -use Parser; +use MediaWiki\Parser\Parser; /** * This is a hook handler interface, see docs/Hooks.md in core. diff --git a/src/InputCheck/BaseChecker.php b/src/InputCheck/BaseChecker.php index 28cecb59c..63b6fbbd3 100644 --- a/src/InputCheck/BaseChecker.php +++ b/src/InputCheck/BaseChecker.php @@ -4,7 +4,7 @@ namespace MediaWiki\Extension\Math\InputCheck; use MediaWiki\Extension\Math\MathConfig; use MediaWiki\MediaWikiServices; -use Message; +use MediaWiki\Message\Message; use stdClass; /** diff --git a/src/InputCheck/LocalChecker.php b/src/InputCheck/LocalChecker.php index 15427aaa6..10fb9eba5 100644 --- a/src/InputCheck/LocalChecker.php +++ b/src/InputCheck/LocalChecker.php @@ -7,7 +7,7 @@ use MediaWiki\Extension\Math\Hooks\HookRunner; use MediaWiki\Extension\Math\MathRenderer; use MediaWiki\Extension\Math\WikiTexVC\TexVC; use MediaWiki\HookContainer\HookContainer; -use Message; +use MediaWiki\Message\Message; use WANObjectCache; class LocalChecker extends BaseChecker { diff --git a/src/InputCheck/MathoidChecker.php b/src/InputCheck/MathoidChecker.php index 4acaf123e..674f472f7 100644 --- a/src/InputCheck/MathoidChecker.php +++ b/src/InputCheck/MathoidChecker.php @@ -3,7 +3,7 @@ namespace MediaWiki\Extension\Math\InputCheck; use MediaWiki\Http\HttpRequestFactory; -use Message; +use MediaWiki\Message\Message; use Psr\Log\LoggerInterface; use RuntimeException; use WANObjectCache; diff --git a/src/InputCheck/RestbaseChecker.php b/src/InputCheck/RestbaseChecker.php index b7df35b7c..939866837 100644 --- a/src/InputCheck/RestbaseChecker.php +++ b/src/InputCheck/RestbaseChecker.php @@ -4,7 +4,7 @@ namespace MediaWiki\Extension\Math\InputCheck; use Exception; use MediaWiki\Extension\Math\MathRestbaseInterface; -use Message; +use MediaWiki\Message\Message; /** * MediaWiki math extension diff --git a/src/MathConfig.php b/src/MathConfig.php index d28c80efb..7bfaa2b76 100644 --- a/src/MathConfig.php +++ b/src/MathConfig.php @@ -4,7 +4,7 @@ namespace MediaWiki\Extension\Math; use ExtensionRegistry; use MediaWiki\Config\ServiceOptions; -use Message; +use MediaWiki\Message\Message; use Wikibase\Client\WikibaseClient; class MathConfig { diff --git a/src/MathRenderer.php b/src/MathRenderer.php index 0225687d3..3ac01e378 100644 --- a/src/MathRenderer.php +++ b/src/MathRenderer.php @@ -11,14 +11,14 @@ namespace MediaWiki\Extension\Math; +use MediaWiki\Context\RequestContext; use MediaWiki\Extension\Math\InputCheck\BaseChecker; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; +use MediaWiki\Message\Message; +use MediaWiki\Parser\Parser; use MediaWiki\Parser\Sanitizer; -use Message; -use Parser; use Psr\Log\LoggerInterface; -use RequestContext; use StringUtils; use WANObjectCache; diff --git a/src/SpecialMathWikibase.php b/src/SpecialMathWikibase.php index 9f38f74b8..202e9140b 100644 --- a/src/SpecialMathWikibase.php +++ b/src/SpecialMathWikibase.php @@ -8,9 +8,9 @@ use MediaWiki\Extension\Math\Widget\WikibaseEntitySelector; use MediaWiki\Html\Html; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; +use MediaWiki\Message\Message; use MediaWiki\Output\OutputPage; use MediaWiki\SpecialPage\SpecialPage; -use Message; use OOUI\ButtonInputWidget; use OOUI\FormLayout; diff --git a/src/Widget/MathTestInputForm.php b/src/Widget/MathTestInputForm.php index 0d21c92b8..a0ee4b97d 100644 --- a/src/Widget/MathTestInputForm.php +++ b/src/Widget/MathTestInputForm.php @@ -5,7 +5,7 @@ namespace MediaWiki\Extension\Math\Widget; use MediaWiki\Extension\Math\MathConfig; use MediaWiki\Extension\Math\Render\RendererFactory; use MediaWiki\Extension\Math\SpecialMathStatus; -use OOUIHTMLForm; +use MediaWiki\HTMLForm\OOUIHTMLForm; class MathTestInputForm extends OOUIHTMLForm { diff --git a/tests/phpunit/InputCheck/InputCheckFactoryTest.php b/tests/phpunit/InputCheck/InputCheckFactoryTest.php index cbe9cff20..c196dc09a 100644 --- a/tests/phpunit/InputCheck/InputCheckFactoryTest.php +++ b/tests/phpunit/InputCheck/InputCheckFactoryTest.php @@ -9,9 +9,9 @@ use MediaWiki\Extension\Math\InputCheck\MathoidChecker; use MediaWiki\Extension\Math\InputCheck\RestbaseChecker; use MediaWiki\Http\HttpRequestFactory; use MediaWiki\Logger\LoggerFactory; +use MediaWiki\Message\Message; use MediaWiki\Tests\Unit\MockServiceDependenciesTrait; use MediaWikiIntegrationTestCase; -use Message; use WANObjectCache; /** diff --git a/tests/phpunit/InputCheck/LocalCheckerTest.php b/tests/phpunit/InputCheck/LocalCheckerTest.php index 13980554b..a151d2a38 100644 --- a/tests/phpunit/InputCheck/LocalCheckerTest.php +++ b/tests/phpunit/InputCheck/LocalCheckerTest.php @@ -3,8 +3,8 @@ namespace MediaWiki\Extension\Math\InputCheck; use HashBagOStuff; +use MediaWiki\Message\Message; use MediaWikiIntegrationTestCase; -use Message; use WANObjectCache; /** diff --git a/tests/phpunit/InputCheck/RestbaseCheckerTest.php b/tests/phpunit/InputCheck/RestbaseCheckerTest.php index 805cc72b6..761451139 100644 --- a/tests/phpunit/InputCheck/RestbaseCheckerTest.php +++ b/tests/phpunit/InputCheck/RestbaseCheckerTest.php @@ -2,6 +2,7 @@ use MediaWiki\Extension\Math\InputCheck\RestbaseChecker; use MediaWiki\Extension\Math\Tests\MathMockHttpTrait; +use MediaWiki\Message\Message; /** * @group Math diff --git a/tests/phpunit/MathMathMLTest.php b/tests/phpunit/MathMathMLTest.php index 63ec3abae..0716eff9e 100644 --- a/tests/phpunit/MathMathMLTest.php +++ b/tests/phpunit/MathMathMLTest.php @@ -3,6 +3,7 @@ use MediaWiki\Extension\Math\MathMathML; use MediaWiki\Extension\Math\MathRestbaseInterface; use MediaWiki\Extension\Math\Tests\MathMockHttpTrait; +use MediaWiki\Parser\Parser; use Wikimedia\TestingAccessWrapper; /** diff --git a/tests/phpunit/integration/PreferencesIntegrationTest.php b/tests/phpunit/integration/PreferencesIntegrationTest.php index 818c8449d..0a86cf8cc 100644 --- a/tests/phpunit/integration/PreferencesIntegrationTest.php +++ b/tests/phpunit/integration/PreferencesIntegrationTest.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Math\Tests; +use MediaWiki\Context\RequestContext; use MediaWiki\Title\Title; use MediaWikiIntegrationTestCase; -use RequestContext; /** * @covers \MediaWiki\Extension\Math\HookHandlers\PreferencesHooksHandler diff --git a/tests/wfTest.php b/tests/wfTest.php index 8c16c2dc9..4914bd8a7 100644 --- a/tests/wfTest.php +++ b/tests/wfTest.php @@ -7,6 +7,7 @@ require_once __DIR__ . '/../../../maintenance/Maintenance.php'; use MediaWiki\Extension\Math\MathConfig; use MediaWiki\Extension\Math\MathMathMLCli; use MediaWiki\MediaWikiServices; +use MediaWiki\Parser\Parser; use MediaWiki\Parser\Sanitizer; use MediaWiki\Title\Title;