From c3af3157b4a523edf754c0b5fe58449a9596881a Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Wed, 12 Jun 2024 20:01:35 +0200 Subject: [PATCH] Use namespaced classes Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I48fcc02c61d423c9c5111ae545634fdc5c5cc710 --- includes/AbuseFilterChangesList.php | 4 ++-- includes/Api/CheckMatch.php | 2 +- includes/BlockedDomainFilter.php | 2 +- includes/BlockedDomainStorage.php | 6 +++--- includes/EditBox/EditBoxField.php | 2 +- includes/FilterImporter.php | 2 +- includes/FilterValidator.php | 2 +- includes/Hooks/Handlers/EchoHandler.php | 8 ++++---- includes/Hooks/Handlers/EditPermissionHandler.php | 2 +- includes/Hooks/Handlers/FilteredActionsHandler.php | 2 +- includes/Hooks/Handlers/SchemaChangesHandler.php | 4 ++-- includes/Hooks/Handlers/ToolLinksHandler.php | 2 +- .../AbuseFilterBlockedDomainHitLogFormatter.php | 2 +- includes/LogFormatter/AbuseFilterModifyLogFormatter.php | 2 +- includes/LogFormatter/AbuseLogHitFormatter.php | 2 +- includes/Pager/AbuseFilterHistoryPager.php | 2 +- includes/Pager/AbuseLogPager.php | 2 +- includes/Parser/Exception/UserVisibleException.php | 2 +- includes/Parser/Exception/UserVisibleWarning.php | 2 +- includes/Parser/SyntaxChecker.php | 2 +- includes/ServiceWiring.php | 1 + includes/Special/BlockedExternalDomains.php | 2 +- includes/Special/SpecialAbuseLog.php | 2 +- includes/SpecsFormatter.php | 2 +- includes/TextExtractor.php | 2 +- includes/ThrottleFilterPresentationModel.php | 4 ++-- includes/Variables/LazyVariableComputer.php | 2 +- includes/Variables/VariablesBlobStore.php | 2 +- includes/View/AbuseFilterView.php | 4 ++-- includes/View/AbuseFilterViewDiff.php | 4 ++-- includes/View/AbuseFilterViewEdit.php | 4 ++-- includes/View/AbuseFilterViewExamine.php | 4 ++-- includes/View/AbuseFilterViewHistory.php | 4 ++-- includes/View/AbuseFilterViewImport.php | 2 +- includes/View/AbuseFilterViewList.php | 4 ++-- includes/View/AbuseFilterViewRevert.php | 6 +++--- includes/View/AbuseFilterViewTestBatch.php | 4 ++-- includes/View/AbuseFilterViewTools.php | 4 ++-- includes/View/HideAbuseLog.php | 4 ++-- maintenance/UpdateVarDumps.php | 2 +- tests/phpunit/AbuseFilterConsequencesTest.php | 3 +++ tests/phpunit/AbuseFilterFilterUserTest.php | 1 + tests/phpunit/AbuseFilterUploadTestTrait.php | 1 + tests/phpunit/SchemaChangesHandlerTest.php | 2 ++ .../integration/ActionVariablesIntegrationTest.php | 8 ++++---- tests/phpunit/integration/Api/CheckMatchTest.php | 4 ++-- tests/phpunit/integration/Api/CheckSyntaxTest.php | 2 +- tests/phpunit/integration/Api/EvalExpressionTest.php | 2 +- tests/phpunit/integration/Api/QueryAbuseLogTest.php | 2 +- tests/phpunit/integration/Api/UnblockAutopromoteTest.php | 2 +- tests/phpunit/integration/FilteredActionsHandlerTest.php | 4 ++-- tests/phpunit/unit/Hooks/ToolLinksHandlerTest.php | 4 ++-- tests/phpunit/unit/TextExtractorTest.php | 2 +- tests/phpunit/unit/Variables/VariablesBlobStoreTest.php | 2 +- 54 files changed, 82 insertions(+), 74 deletions(-) diff --git a/includes/AbuseFilterChangesList.php b/includes/AbuseFilterChangesList.php index cb33dfccc..4b0095f24 100644 --- a/includes/AbuseFilterChangesList.php +++ b/includes/AbuseFilterChangesList.php @@ -3,15 +3,15 @@ namespace MediaWiki\Extension\AbuseFilter; use HtmlArmor; -use IContextSource; use LogFormatter; +use MediaWiki\Context\IContextSource; use MediaWiki\Linker\Linker; use MediaWiki\MediaWikiServices; use MediaWiki\Revision\RevisionRecord; use MediaWiki\SpecialPage\SpecialPage; +use MediaWiki\Title\TitleValue; use OldChangesList; use RecentChange; -use TitleValue; class AbuseFilterChangesList extends OldChangesList { diff --git a/includes/Api/CheckMatch.php b/includes/Api/CheckMatch.php index 24e20bfa8..1ce3c8020 100644 --- a/includes/Api/CheckMatch.php +++ b/includes/Api/CheckMatch.php @@ -5,7 +5,6 @@ namespace MediaWiki\Extension\AbuseFilter\Api; use ApiBase; use ApiMain; use ApiResult; -use FormatJson; use LogEventsList; use LogicException; use LogPage; @@ -15,6 +14,7 @@ use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseLog; use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore; +use MediaWiki\Json\FormatJson; use MediaWiki\Revision\RevisionRecord; use RecentChange; use Wikimedia\ParamValidator\ParamValidator; diff --git a/includes/BlockedDomainFilter.php b/includes/BlockedDomainFilter.php index 88eb357aa..4f3d8035b 100644 --- a/includes/BlockedDomainFilter.php +++ b/includes/BlockedDomainFilter.php @@ -26,10 +26,10 @@ use MediaWiki\CheckUser\Hooks as CUHooks; use MediaWiki\Extension\AbuseFilter\Variables\UnsetVariableException; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; +use MediaWiki\Message\Message; use MediaWiki\Status\Status; use MediaWiki\Title\Title; use MediaWiki\User\User; -use Message; /** * Filters blocked domains diff --git a/includes/BlockedDomainStorage.php b/includes/BlockedDomainStorage.php index d80a54a77..2933a9557 100644 --- a/includes/BlockedDomainStorage.php +++ b/includes/BlockedDomainStorage.php @@ -22,10 +22,11 @@ namespace MediaWiki\Extension\AbuseFilter; use ApiRawMessage; use BagOStuff; use DBAccessObjectUtils; -use FormatJson; use IDBAccessObject; -use JsonContent; use MediaWiki\CommentStore\CommentStoreComment; +use MediaWiki\Content\JsonContent; +use MediaWiki\Json\FormatJson; +use MediaWiki\Message\Message; use MediaWiki\Page\WikiPageFactory; use MediaWiki\Revision\RevisionLookup; use MediaWiki\Revision\RevisionRecord; @@ -33,7 +34,6 @@ use MediaWiki\Revision\SlotRecord; use MediaWiki\Title\TitleValue; use MediaWiki\User\UserFactory; use MediaWiki\Utils\UrlUtils; -use Message; use RecentChange; use StatusValue; diff --git a/includes/EditBox/EditBoxField.php b/includes/EditBox/EditBoxField.php index 9b2f31998..8d91d9231 100644 --- a/includes/EditBox/EditBoxField.php +++ b/includes/EditBox/EditBoxField.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter\EditBox; -use HTMLFormField; +use MediaWiki\HTMLForm\HTMLFormField; /** * This class is used to easily wrap a filter editor box inside an HTMLForm. For now it's just a transparent diff --git a/includes/FilterImporter.php b/includes/FilterImporter.php index 0bd1be200..6d7de4463 100644 --- a/includes/FilterImporter.php +++ b/includes/FilterImporter.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter; -use FormatJson; use LogicException; use MediaWiki\Config\ServiceOptions; use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesRegistry; @@ -11,6 +10,7 @@ use MediaWiki\Extension\AbuseFilter\Filter\Flags; use MediaWiki\Extension\AbuseFilter\Filter\LastEditInfo; use MediaWiki\Extension\AbuseFilter\Filter\MutableFilter; use MediaWiki\Extension\AbuseFilter\Filter\Specs; +use MediaWiki\Json\FormatJson; /** * This class allows encoding filters to (and decoding from) a string format that can be used diff --git a/includes/FilterValidator.php b/includes/FilterValidator.php index b10eeb2b8..321090c57 100644 --- a/includes/FilterValidator.php +++ b/includes/FilterValidator.php @@ -7,9 +7,9 @@ use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagValidator; use MediaWiki\Extension\AbuseFilter\Filter\AbstractFilter; use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory; +use MediaWiki\Message\Message; use MediaWiki\Permissions\Authority; use MediaWiki\Status\Status; -use Message; /** * This class validates filters, e.g. before saving. diff --git a/includes/Hooks/Handlers/EchoHandler.php b/includes/Hooks/Handlers/EchoHandler.php index 2332a4592..cb8bf2777 100644 --- a/includes/Hooks/Handlers/EchoHandler.php +++ b/includes/Hooks/Handlers/EchoHandler.php @@ -2,11 +2,11 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; -use EchoAttributeManager; -use EchoUserLocator; use MediaWiki\Extension\AbuseFilter\EchoNotifier; use MediaWiki\Extension\AbuseFilter\ThrottleFilterPresentationModel; +use MediaWiki\Extension\Notifications\AttributeManager; use MediaWiki\Extension\Notifications\Hooks\BeforeCreateEchoEventHook; +use MediaWiki\Extension\Notifications\UserLocator; class EchoHandler implements BeforeCreateEchoEventHook { @@ -25,9 +25,9 @@ class EchoHandler implements BeforeCreateEchoEventHook { 'section' => 'alert', 'group' => 'negative', 'presentation-model' => ThrottleFilterPresentationModel::class, - EchoAttributeManager::ATTR_LOCATORS => [ + AttributeManager::ATTR_LOCATORS => [ [ - [ EchoUserLocator::class, 'locateFromEventExtra' ], + [ UserLocator::class, 'locateFromEventExtra' ], [ 'user' ] ] ], diff --git a/includes/Hooks/Handlers/EditPermissionHandler.php b/includes/Hooks/Handlers/EditPermissionHandler.php index 4b7e1743b..4943ba775 100644 --- a/includes/Hooks/Handlers/EditPermissionHandler.php +++ b/includes/Hooks/Handlers/EditPermissionHandler.php @@ -3,8 +3,8 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; -use JsonContent; use MediaWiki\Content\Hook\JsonValidateSaveHook; +use MediaWiki\Content\JsonContent; use MediaWiki\Extension\AbuseFilter\BlockedDomainStorage; use MediaWiki\MediaWikiServices; use MediaWiki\Page\PageIdentity; diff --git a/includes/Hooks/Handlers/FilteredActionsHandler.php b/includes/Hooks/Handlers/FilteredActionsHandler.php index 302f6e3e6..699cceece 100644 --- a/includes/Hooks/Handlers/FilteredActionsHandler.php +++ b/includes/Hooks/Handlers/FilteredActionsHandler.php @@ -5,7 +5,7 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; use ApiMessage; use Content; use IBufferingStatsdDataFactory; -use IContextSource; +use MediaWiki\Context\IContextSource; use MediaWiki\Deferred\DeferredUpdates; use MediaWiki\Extension\AbuseFilter\BlockedDomainFilter; use MediaWiki\Extension\AbuseFilter\EditRevUpdater; diff --git a/includes/Hooks/Handlers/SchemaChangesHandler.php b/includes/Hooks/Handlers/SchemaChangesHandler.php index e528fdf61..6a4d7275c 100644 --- a/includes/Hooks/Handlers/SchemaChangesHandler.php +++ b/includes/Hooks/Handlers/SchemaChangesHandler.php @@ -2,16 +2,16 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; -use DatabaseUpdater; +use MediaWiki\Context\RequestContext; use MediaWiki\Extension\AbuseFilter\Maintenance\MigrateActorsAF; use MediaWiki\Extension\AbuseFilter\Maintenance\UpdateVarDumps; +use MediaWiki\Installer\DatabaseUpdater; use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; use MediaWiki\MediaWikiServices; use MediaWiki\User\User; use MediaWiki\User\UserFactory; use MediaWiki\User\UserGroupManager; use MessageLocalizer; -use RequestContext; class SchemaChangesHandler implements LoadExtensionSchemaUpdatesHook { /** @var MessageLocalizer */ diff --git a/includes/Hooks/Handlers/ToolLinksHandler.php b/includes/Hooks/Handlers/ToolLinksHandler.php index 3be34b2b8..6478fe688 100644 --- a/includes/Hooks/Handlers/ToolLinksHandler.php +++ b/includes/Hooks/Handlers/ToolLinksHandler.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; -use IContextSource; +use MediaWiki\Context\IContextSource; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseLog; use MediaWiki\Linker\LinkRenderer; diff --git a/includes/LogFormatter/AbuseFilterBlockedDomainHitLogFormatter.php b/includes/LogFormatter/AbuseFilterBlockedDomainHitLogFormatter.php index 69e9d1ed7..cfdf2c39c 100644 --- a/includes/LogFormatter/AbuseFilterBlockedDomainHitLogFormatter.php +++ b/includes/LogFormatter/AbuseFilterBlockedDomainHitLogFormatter.php @@ -3,7 +3,7 @@ namespace MediaWiki\Extension\AbuseFilter\LogFormatter; use LogFormatter; -use Message; +use MediaWiki\Message\Message; class AbuseFilterBlockedDomainHitLogFormatter extends LogFormatter { /** diff --git a/includes/LogFormatter/AbuseFilterModifyLogFormatter.php b/includes/LogFormatter/AbuseFilterModifyLogFormatter.php index e7f7a0531..b004583ba 100644 --- a/includes/LogFormatter/AbuseFilterModifyLogFormatter.php +++ b/includes/LogFormatter/AbuseFilterModifyLogFormatter.php @@ -3,8 +3,8 @@ namespace MediaWiki\Extension\AbuseFilter\LogFormatter; use LogFormatter; +use MediaWiki\Message\Message; use MediaWiki\SpecialPage\SpecialPage; -use Message; class AbuseFilterModifyLogFormatter extends LogFormatter { diff --git a/includes/LogFormatter/AbuseLogHitFormatter.php b/includes/LogFormatter/AbuseLogHitFormatter.php index 72eddf845..cd099630e 100644 --- a/includes/LogFormatter/AbuseLogHitFormatter.php +++ b/includes/LogFormatter/AbuseLogHitFormatter.php @@ -5,8 +5,8 @@ namespace MediaWiki\Extension\AbuseFilter\LogFormatter; use LogEntry; use LogFormatter; use MediaWiki\Extension\AbuseFilter\SpecsFormatter; +use MediaWiki\Message\Message; use MediaWiki\SpecialPage\SpecialPage; -use Message; /** * This class formats abuse log notifications. diff --git a/includes/Pager/AbuseFilterHistoryPager.php b/includes/Pager/AbuseFilterHistoryPager.php index 492ff2958..9b76894c6 100644 --- a/includes/Pager/AbuseFilterHistoryPager.php +++ b/includes/Pager/AbuseFilterHistoryPager.php @@ -3,8 +3,8 @@ namespace MediaWiki\Extension\AbuseFilter\Pager; use HtmlArmor; -use IContextSource; use MediaWiki\Cache\LinkBatchFactory; +use MediaWiki\Context\IContextSource; use MediaWiki\Extension\AbuseFilter\AbuseFilter; use MediaWiki\Extension\AbuseFilter\AbuseFilterServices; use MediaWiki\Extension\AbuseFilter\Filter\Flags; diff --git a/includes/Pager/AbuseLogPager.php b/includes/Pager/AbuseLogPager.php index 3c34e5ea6..6f01c2817 100644 --- a/includes/Pager/AbuseLogPager.php +++ b/includes/Pager/AbuseLogPager.php @@ -3,8 +3,8 @@ namespace MediaWiki\Extension\AbuseFilter\Pager; use HtmlArmor; -use IContextSource; use MediaWiki\Cache\LinkBatchFactory; +use MediaWiki\Context\IContextSource; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\AbuseFilterServices; use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException; diff --git a/includes/Parser/Exception/UserVisibleException.php b/includes/Parser/Exception/UserVisibleException.php index 69ac10e1b..b63182be9 100644 --- a/includes/Parser/Exception/UserVisibleException.php +++ b/includes/Parser/Exception/UserVisibleException.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter\Parser\Exception; -use Message; +use MediaWiki\Message\Message; /** * Exceptions that we might conceivably want to report to ordinary users diff --git a/includes/Parser/Exception/UserVisibleWarning.php b/includes/Parser/Exception/UserVisibleWarning.php index 364c5228c..4191fab17 100644 --- a/includes/Parser/Exception/UserVisibleWarning.php +++ b/includes/Parser/Exception/UserVisibleWarning.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter\Parser\Exception; -use Message; +use MediaWiki\Message\Message; /** * A variant of user-visible exception that is not fatal. diff --git a/includes/Parser/SyntaxChecker.php b/includes/Parser/SyntaxChecker.php index e800c6612..0b4604417 100644 --- a/includes/Parser/SyntaxChecker.php +++ b/includes/Parser/SyntaxChecker.php @@ -7,7 +7,7 @@ use LogicException; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Parser\Exception\InternalException; use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; -use Message; +use MediaWiki\Message\Message; /** * SyntaxChecker statically analyzes the code without actually running it. diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 3f3b95efa..258e77c0b 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -1,6 +1,7 @@