diff --git a/includes/AbuseFilterPreAuthenticationProvider.php b/includes/AbuseFilterPreAuthenticationProvider.php index c91d239fc..399f42a18 100644 --- a/includes/AbuseFilterPreAuthenticationProvider.php +++ b/includes/AbuseFilterPreAuthenticationProvider.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter; -use IBufferingStatsdDataFactory; use MediaWiki\Auth\AbstractPreAuthenticationProvider; use MediaWiki\Auth\AuthenticationRequest; use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory; @@ -10,6 +9,7 @@ use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\User\User; use MediaWiki\User\UserFactory; use StatusValue; +use Wikimedia\Stats\IBufferingStatsdDataFactory; /** * AuthenticationProvider used to filter account creations. This runs after normal preauth providers diff --git a/includes/AbuseLogger.php b/includes/AbuseLogger.php index 5927b5582..00a5a917b 100644 --- a/includes/AbuseLogger.php +++ b/includes/AbuseLogger.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter; -use ExtensionRegistry; use InvalidArgumentException; use ManualLogEntry; use MediaWiki\CheckUser\Hooks; @@ -11,6 +10,7 @@ use MediaWiki\Deferred\DeferredUpdates; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; +use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWiki\User\UserIdentityValue; diff --git a/includes/Api/AbuseLogPrivateDetails.php b/includes/Api/AbuseLogPrivateDetails.php index 53d44f289..7efb1d9a6 100644 --- a/includes/Api/AbuseLogPrivateDetails.php +++ b/includes/Api/AbuseLogPrivateDetails.php @@ -18,8 +18,8 @@ namespace MediaWiki\Extension\AbuseFilter\Api; -use ApiBase; -use ApiMain; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseLog; use Wikimedia\ParamValidator\ParamValidator; diff --git a/includes/Api/CheckMatch.php b/includes/Api/CheckMatch.php index cc462c0b2..7df76c5fb 100644 --- a/includes/Api/CheckMatch.php +++ b/includes/Api/CheckMatch.php @@ -2,12 +2,12 @@ namespace MediaWiki\Extension\AbuseFilter\Api; -use ApiBase; -use ApiMain; -use ApiResult; use LogEventsList; use LogicException; use LogPage; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; +use MediaWiki\Api\ApiResult; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\AbuseFilterServices; use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory; diff --git a/includes/Api/CheckSyntax.php b/includes/Api/CheckSyntax.php index 84c3ea746..4348771d9 100644 --- a/includes/Api/CheckSyntax.php +++ b/includes/Api/CheckSyntax.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter\Api; -use ApiBase; -use ApiMain; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory; diff --git a/includes/Api/EvalExpression.php b/includes/Api/EvalExpression.php index 2a642273a..5f2bc4997 100644 --- a/includes/Api/EvalExpression.php +++ b/includes/Api/EvalExpression.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\AbuseFilter\Api; -use ApiBase; -use ApiMain; -use ApiResult; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; +use MediaWiki\Api\ApiResult; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory; use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory; diff --git a/includes/Api/QueryAbuseFilters.php b/includes/Api/QueryAbuseFilters.php index 7ec7eb260..2997116b2 100644 --- a/includes/Api/QueryAbuseFilters.php +++ b/includes/Api/QueryAbuseFilters.php @@ -18,9 +18,9 @@ namespace MediaWiki\Extension\AbuseFilter\Api; -use ApiBase; -use ApiQuery; -use ApiQueryBase; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiQuery; +use MediaWiki\Api\ApiQueryBase; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\Filter\Flags; use MediaWiki\Extension\AbuseFilter\FilterUtils; diff --git a/includes/Api/QueryAbuseLog.php b/includes/Api/QueryAbuseLog.php index 4408cde4b..6f384a1d7 100644 --- a/includes/Api/QueryAbuseLog.php +++ b/includes/Api/QueryAbuseLog.php @@ -18,10 +18,10 @@ namespace MediaWiki\Extension\AbuseFilter\Api; -use ApiBase; -use ApiQuery; -use ApiQueryBase; use InvalidArgumentException; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiQuery; +use MediaWiki\Api\ApiQueryBase; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; use MediaWiki\Extension\AbuseFilter\AbuseLoggerFactory; use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException; diff --git a/includes/Api/UnblockAutopromote.php b/includes/Api/UnblockAutopromote.php index 3bb40f81f..f123ab3c5 100644 --- a/includes/Api/UnblockAutopromote.php +++ b/includes/Api/UnblockAutopromote.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter\Api; -use ApiBase; -use ApiMain; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore; use MediaWiki\ParamValidator\TypeDef\UserDef; use Wikimedia\ParamValidator\ParamValidator; diff --git a/includes/BlockAutopromoteStore.php b/includes/BlockAutopromoteStore.php index 14a355471..04cc91e9a 100644 --- a/includes/BlockAutopromoteStore.php +++ b/includes/BlockAutopromoteStore.php @@ -2,11 +2,11 @@ namespace MediaWiki\Extension\AbuseFilter; -use BagOStuff; use ManualLogEntry; use MediaWiki\Title\TitleValue; use MediaWiki\User\UserIdentity; use Psr\Log\LoggerInterface; +use Wikimedia\ObjectCache\BagOStuff; /** * Class responsible for storing and retrieving blockautopromote status diff --git a/includes/BlockedDomainFilter.php b/includes/BlockedDomainFilter.php index 86cba0415..5f1660c92 100644 --- a/includes/BlockedDomainFilter.php +++ b/includes/BlockedDomainFilter.php @@ -19,7 +19,6 @@ */ namespace MediaWiki\Extension\AbuseFilter; -use ExtensionRegistry; use LogPage; use ManualLogEntry; use MediaWiki\CheckUser\Hooks as CUHooks; @@ -27,6 +26,7 @@ use MediaWiki\Extension\AbuseFilter\Variables\UnsetVariableException; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; use MediaWiki\Message\Message; +use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\Status\Status; use MediaWiki\Title\Title; use MediaWiki\User\User; diff --git a/includes/BlockedDomainStorage.php b/includes/BlockedDomainStorage.php index ebce0755e..5cf8cf89a 100644 --- a/includes/BlockedDomainStorage.php +++ b/includes/BlockedDomainStorage.php @@ -19,10 +19,7 @@ */ namespace MediaWiki\Extension\AbuseFilter; -use ApiRawMessage; -use BagOStuff; -use DBAccessObjectUtils; -use IDBAccessObject; +use MediaWiki\Api\ApiRawMessage; use MediaWiki\CommentStore\CommentStoreComment; use MediaWiki\Content\JsonContent; use MediaWiki\Json\FormatJson; @@ -38,6 +35,9 @@ use MediaWiki\User\UserIdentity; use MediaWiki\Utils\UrlUtils; use RecentChange; use StatusValue; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\Rdbms\DBAccessObjectUtils; +use Wikimedia\Rdbms\IDBAccessObject; /** * Hold and update information about blocked external domains diff --git a/includes/ChangeTags/ChangeTagsManager.php b/includes/ChangeTags/ChangeTagsManager.php index 7b57c984c..bbb24ec1c 100644 --- a/includes/ChangeTags/ChangeTagsManager.php +++ b/includes/ChangeTags/ChangeTagsManager.php @@ -5,7 +5,7 @@ namespace MediaWiki\Extension\AbuseFilter\ChangeTags; use MediaWiki\ChangeTags\ChangeTagsStore; use MediaWiki\Extension\AbuseFilter\CentralDBManager; use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException; -use WANObjectCache; +use Wikimedia\ObjectCache\WANObjectCache; use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IReadableDatabase; use Wikimedia\Rdbms\LBFactory; diff --git a/includes/Consequences/Consequence/Throttle.php b/includes/Consequences/Consequence/Throttle.php index ff0112e47..988e3348a 100644 --- a/includes/Consequences/Consequence/Throttle.php +++ b/includes/Consequences/Consequence/Throttle.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter\Consequences\Consequence; -use BagOStuff; use InvalidArgumentException; use MediaWiki\Extension\AbuseFilter\Consequences\ConsequenceNotPrecheckedException; use MediaWiki\Extension\AbuseFilter\Consequences\Parameters; @@ -11,6 +10,7 @@ use MediaWiki\User\UserEditTracker; use MediaWiki\User\UserFactory; use Psr\Log\LoggerInterface; use Wikimedia\IPUtils; +use Wikimedia\ObjectCache\BagOStuff; /** * Consequence that delays executing other actions until certain conditions are met diff --git a/includes/Consequences/ConsequencesFactory.php b/includes/Consequences/ConsequencesFactory.php index 3b684f79e..8c59c1b5a 100644 --- a/includes/Consequences/ConsequencesFactory.php +++ b/includes/Consequences/ConsequencesFactory.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter\Consequences; -use BagOStuff; use MediaWiki\Block\BlockUserFactory; use MediaWiki\Block\DatabaseBlockStore; use MediaWiki\Config\ServiceOptions; @@ -26,6 +25,7 @@ use MediaWiki\User\UserGroupManager; use MediaWiki\User\UserIdentityUtils; use MessageLocalizer; use Psr\Log\LoggerInterface; +use Wikimedia\ObjectCache\BagOStuff; class ConsequencesFactory { public const SERVICE_NAME = 'AbuseFilterConsequencesFactory'; diff --git a/includes/EditStashCache.php b/includes/EditStashCache.php index d58977d99..1720fad12 100644 --- a/includes/EditStashCache.php +++ b/includes/EditStashCache.php @@ -2,13 +2,13 @@ namespace MediaWiki\Extension\AbuseFilter; -use BagOStuff; -use IBufferingStatsdDataFactory; use InvalidArgumentException; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; use MediaWiki\Linker\LinkTarget; use Psr\Log\LoggerInterface; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\Stats\IBufferingStatsdDataFactory; /** * Wrapper around cache for storing and retrieving data from edit stash diff --git a/includes/EmergencyCache.php b/includes/EmergencyCache.php index d50ca7440..11b9339ef 100644 --- a/includes/EmergencyCache.php +++ b/includes/EmergencyCache.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter; -use BagOStuff; +use Wikimedia\ObjectCache\BagOStuff; /** * Helper class for EmergencyWatcher. Wrapper around cache which tracks hits of recently diff --git a/includes/FilterLookup.php b/includes/FilterLookup.php index a47da3b55..d00532a17 100644 --- a/includes/FilterLookup.php +++ b/includes/FilterLookup.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter; -use IDBAccessObject; use MediaWiki\Extension\AbuseFilter\Filter\ClosestFilterVersionNotFoundException; use MediaWiki\Extension\AbuseFilter\Filter\ExistingFilter; use MediaWiki\Extension\AbuseFilter\Filter\FilterNotFoundException; @@ -13,7 +12,8 @@ use MediaWiki\Extension\AbuseFilter\Filter\LastEditInfo; use MediaWiki\Extension\AbuseFilter\Filter\Specs; use RuntimeException; use stdClass; -use WANObjectCache; +use Wikimedia\ObjectCache\WANObjectCache; +use Wikimedia\Rdbms\IDBAccessObject; use Wikimedia\Rdbms\ILoadBalancer; use Wikimedia\Rdbms\IReadableDatabase; use Wikimedia\Rdbms\SelectQueryBuilder; diff --git a/includes/FilterProfiler.php b/includes/FilterProfiler.php index d18538917..7a2e734e1 100644 --- a/includes/FilterProfiler.php +++ b/includes/FilterProfiler.php @@ -2,11 +2,11 @@ namespace MediaWiki\Extension\AbuseFilter; -use BagOStuff; -use IBufferingStatsdDataFactory; use MediaWiki\Config\ServiceOptions; use MediaWiki\Title\Title; use Psr\Log\LoggerInterface; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\Stats\IBufferingStatsdDataFactory; use Wikimedia\WRStats\LocalEntityKey; use Wikimedia\WRStats\WRStatsFactory; diff --git a/includes/FilterRunnerFactory.php b/includes/FilterRunnerFactory.php index 969fade52..4c13abb34 100644 --- a/includes/FilterRunnerFactory.php +++ b/includes/FilterRunnerFactory.php @@ -2,8 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter; -use BagOStuff; -use IBufferingStatsdDataFactory; use MediaWiki\Config\ServiceOptions; use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagger; use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesExecutorFactory; @@ -16,8 +14,10 @@ use MediaWiki\Extension\AbuseFilter\Watcher\EmergencyWatcher; use MediaWiki\Extension\AbuseFilter\Watcher\UpdateHitCountWatcher; use MediaWiki\Title\Title; use MediaWiki\User\User; -use NullStatsdDataFactory; use Psr\Log\LoggerInterface; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\Stats\IBufferingStatsdDataFactory; +use Wikimedia\Stats\NullStatsdDataFactory; class FilterRunnerFactory { public const SERVICE_NAME = 'AbuseFilterFilterRunnerFactory'; diff --git a/includes/Hooks/AbuseFilterContentToStringHook.php b/includes/Hooks/AbuseFilterContentToStringHook.php index 6e122d5b5..31dcf6439 100644 --- a/includes/Hooks/AbuseFilterContentToStringHook.php +++ b/includes/Hooks/AbuseFilterContentToStringHook.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks; -use Content; +use MediaWiki\Content\Content; interface AbuseFilterContentToStringHook { /** diff --git a/includes/Hooks/AbuseFilterHookRunner.php b/includes/Hooks/AbuseFilterHookRunner.php index fd753170e..e2e9124ba 100644 --- a/includes/Hooks/AbuseFilterHookRunner.php +++ b/includes/Hooks/AbuseFilterHookRunner.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks; -use Content; +use MediaWiki\Content\Content; use MediaWiki\Extension\AbuseFilter\VariableGenerator\RCVariableGenerator; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\HookContainer\HookContainer; diff --git a/includes/Hooks/Handlers/AutoPromoteGroupsHandler.php b/includes/Hooks/Handlers/AutoPromoteGroupsHandler.php index 05f1621b4..77e8d67e4 100644 --- a/includes/Hooks/Handlers/AutoPromoteGroupsHandler.php +++ b/includes/Hooks/Handlers/AutoPromoteGroupsHandler.php @@ -2,12 +2,12 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; -use BagOStuff; -use HashBagOStuff; use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore; use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesRegistry; use MediaWiki\User\Hook\GetAutoPromoteGroupsHook; use MediaWiki\User\UserIdentity; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\ObjectCache\HashBagOStuff; class AutoPromoteGroupsHandler implements GetAutoPromoteGroupsHook { diff --git a/includes/Hooks/Handlers/ConfirmEditHandler.php b/includes/Hooks/Handlers/ConfirmEditHandler.php index 299e9cd70..d6bed2be0 100644 --- a/includes/Hooks/Handlers/ConfirmEditHandler.php +++ b/includes/Hooks/Handlers/ConfirmEditHandler.php @@ -2,11 +2,11 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; -use Content; -use ExtensionRegistry; +use MediaWiki\Content\Content; use MediaWiki\Context\IContextSource; use MediaWiki\Extension\ConfirmEdit\Hooks; use MediaWiki\Hook\EditFilterMergedContentHook; +use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\Status\Status; use MediaWiki\User\User; diff --git a/includes/Hooks/Handlers/FilteredActionsHandler.php b/includes/Hooks/Handlers/FilteredActionsHandler.php index 699cceece..59292e083 100644 --- a/includes/Hooks/Handlers/FilteredActionsHandler.php +++ b/includes/Hooks/Handlers/FilteredActionsHandler.php @@ -2,9 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; -use ApiMessage; -use Content; -use IBufferingStatsdDataFactory; +use MediaWiki\Api\ApiMessage; +use MediaWiki\Content\Content; use MediaWiki\Context\IContextSource; use MediaWiki\Deferred\DeferredUpdates; use MediaWiki\Extension\AbuseFilter\BlockedDomainFilter; @@ -24,6 +23,7 @@ use MediaWiki\Storage\Hook\ParserOutputStashForEditHook; use MediaWiki\Title\Title; use MediaWiki\User\User; use UploadBase; +use Wikimedia\Stats\IBufferingStatsdDataFactory; use WikiPage; /** diff --git a/includes/Parser/AFPTreeParser.php b/includes/Parser/AFPTreeParser.php index bcfc5ab0f..2051df56c 100644 --- a/includes/Parser/AFPTreeParser.php +++ b/includes/Parser/AFPTreeParser.php @@ -10,11 +10,11 @@ namespace MediaWiki\Extension\AbuseFilter\Parser; -use IBufferingStatsdDataFactory; use InvalidArgumentException; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; use Psr\Log\LoggerInterface; +use Wikimedia\Stats\IBufferingStatsdDataFactory; /** * A parser that transforms the text of the filter into a parse tree. diff --git a/includes/Parser/AbuseFilterTokenizer.php b/includes/Parser/AbuseFilterTokenizer.php index c53169ab6..49c00bdce 100644 --- a/includes/Parser/AbuseFilterTokenizer.php +++ b/includes/Parser/AbuseFilterTokenizer.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter\Parser; -use BagOStuff; use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; +use Wikimedia\ObjectCache\BagOStuff; /** * Tokenizer for AbuseFilter rules. diff --git a/includes/Parser/FilterEvaluator.php b/includes/Parser/FilterEvaluator.php index c2199e348..f0ad5da72 100644 --- a/includes/Parser/FilterEvaluator.php +++ b/includes/Parser/FilterEvaluator.php @@ -2,11 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter\Parser; -use BagOStuff; use Exception; -use IBufferingStatsdDataFactory; use InvalidArgumentException; -use Language; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Parser\Exception\ConditionLimitException; use MediaWiki\Extension\AbuseFilter\Parser\Exception\ExceptionBase; @@ -15,10 +12,13 @@ use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleWarning; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; +use MediaWiki\Language\Language; use MediaWiki\Parser\Sanitizer; use Psr\Log\LoggerInterface; use Wikimedia\Equivset\Equivset; use Wikimedia\IPUtils; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\Stats\IBufferingStatsdDataFactory; /** * This class evaluates an AST generated by the filter parser. diff --git a/includes/Parser/RuleCheckerFactory.php b/includes/Parser/RuleCheckerFactory.php index ed428810d..47f0be340 100644 --- a/includes/Parser/RuleCheckerFactory.php +++ b/includes/Parser/RuleCheckerFactory.php @@ -2,14 +2,14 @@ namespace MediaWiki\Extension\AbuseFilter\Parser; -use BagOStuff; -use IBufferingStatsdDataFactory; -use Language; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; +use MediaWiki\Language\Language; use Psr\Log\LoggerInterface; use Wikimedia\Equivset\Equivset; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\Stats\IBufferingStatsdDataFactory; class RuleCheckerFactory { public const SERVICE_NAME = 'AbuseFilterRuleCheckerFactory'; diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index ed9d1de13..a49c2babc 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -44,6 +44,7 @@ use MediaWiki\Extension\AbuseFilter\Watcher\EmergencyWatcher; use MediaWiki\Extension\AbuseFilter\Watcher\UpdateHitCountWatcher; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; +use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\WikiMap\WikiMap; use Wikimedia\Equivset\Equivset; diff --git a/includes/Special/BlockedExternalDomains.php b/includes/Special/BlockedExternalDomains.php index 7d5969737..04ba290b6 100644 --- a/includes/Special/BlockedExternalDomains.php +++ b/includes/Special/BlockedExternalDomains.php @@ -20,14 +20,14 @@ namespace MediaWiki\Extension\AbuseFilter\Special; use ErrorPageError; -use IDBAccessObject; use MediaWiki\Extension\AbuseFilter\BlockedDomainStorage; use MediaWiki\Html\Html; use MediaWiki\HTMLForm\HTMLForm; use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\Title\TitleValue; use PermissionsError; -use WANObjectCache; +use Wikimedia\ObjectCache\WANObjectCache; +use Wikimedia\Rdbms\IDBAccessObject; /** * List and manage blocked external domains diff --git a/includes/Special/SpecialAbuseLog.php b/includes/Special/SpecialAbuseLog.php index bf7be7f3f..3b4acb316 100644 --- a/includes/Special/SpecialAbuseLog.php +++ b/includes/Special/SpecialAbuseLog.php @@ -3,7 +3,6 @@ namespace MediaWiki\Extension\AbuseFilter\Special; use DifferenceEngine; -use ExtensionRegistry; use InvalidArgumentException; use ManualLogEntry; use MediaWiki\Cache\LinkBatchFactory; @@ -31,6 +30,7 @@ use MediaWiki\Linker\Linker; use MediaWiki\MediaWikiServices; use MediaWiki\Permissions\Authority; use MediaWiki\Permissions\PermissionManager; +use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\Revision\RevisionRecord; use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\Status\Status; diff --git a/includes/SpecsFormatter.php b/includes/SpecsFormatter.php index b682f250d..f23f11daf 100644 --- a/includes/SpecsFormatter.php +++ b/includes/SpecsFormatter.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter; -use Language; use MediaWiki\Extension\AbuseFilter\Filter\AbstractFilter; +use MediaWiki\Language\Language; use MediaWiki\Language\RawMessage; use MediaWiki\Message\Message; use MessageLocalizer; diff --git a/includes/TextExtractor.php b/includes/TextExtractor.php index 7b969b6cd..21dbc42fc 100644 --- a/includes/TextExtractor.php +++ b/includes/TextExtractor.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter; -use Content; +use MediaWiki\Content\Content; use MediaWiki\Content\TextContent; use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; use MediaWiki\Permissions\Authority; diff --git a/includes/VariableGenerator/RCVariableGenerator.php b/includes/VariableGenerator/RCVariableGenerator.php index 0d4a48624..da75c6746 100644 --- a/includes/VariableGenerator/RCVariableGenerator.php +++ b/includes/VariableGenerator/RCVariableGenerator.php @@ -10,10 +10,10 @@ use MediaWiki\Page\WikiPageFactory; use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWiki\User\UserFactory; -use MimeAnalyzer; use MWFileProps; use RecentChange; use RepoGroup; +use Wikimedia\Mime\MimeAnalyzer; /** * This class contains the logic used to create variable holders used to diff --git a/includes/VariableGenerator/RunVariableGenerator.php b/includes/VariableGenerator/RunVariableGenerator.php index 2104d0ea1..f732eb01a 100644 --- a/includes/VariableGenerator/RunVariableGenerator.php +++ b/includes/VariableGenerator/RunVariableGenerator.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter\VariableGenerator; -use Content; use LogicException; +use MediaWiki\Content\Content; use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; use MediaWiki\Extension\AbuseFilter\TextExtractor; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; @@ -14,10 +14,10 @@ use MediaWiki\Revision\SlotRecord; use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWiki\User\UserFactory; -use MimeAnalyzer; use MWFileProps; use UploadBase; use Wikimedia\Assert\PreconditionException; +use Wikimedia\Mime\MimeAnalyzer; use WikiPage; /** diff --git a/includes/VariableGenerator/VariableGeneratorFactory.php b/includes/VariableGenerator/VariableGeneratorFactory.php index adffcfe8a..09f5c2708 100644 --- a/includes/VariableGenerator/VariableGeneratorFactory.php +++ b/includes/VariableGenerator/VariableGeneratorFactory.php @@ -9,9 +9,9 @@ use MediaWiki\Page\WikiPageFactory; use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWiki\User\UserFactory; -use MimeAnalyzer; use RecentChange; use RepoGroup; +use Wikimedia\Mime\MimeAnalyzer; class VariableGeneratorFactory { public const SERVICE_NAME = 'AbuseFilterVariableGeneratorFactory'; diff --git a/includes/Variables/LazyVariableComputer.php b/includes/Variables/LazyVariableComputer.php index c702be538..ebd4c1760 100644 --- a/includes/Variables/LazyVariableComputer.php +++ b/includes/Variables/LazyVariableComputer.php @@ -2,14 +2,16 @@ namespace MediaWiki\Extension\AbuseFilter\Variables; -use ContentHandler; -use Language; +use MediaWiki\Content\ContentHandler; use MediaWiki\Content\TextContent; use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; use MediaWiki\Extension\AbuseFilter\Parser\AFPData; use MediaWiki\Extension\AbuseFilter\TextExtractor; use MediaWiki\ExternalLinks\ExternalLinksLookup; use MediaWiki\ExternalLinks\LinkFilter; +use MediaWiki\Language\Language; +use MediaWiki\Parser\ParserFactory; +use MediaWiki\Parser\ParserOptions; use MediaWiki\Permissions\PermissionManager; use MediaWiki\Permissions\RestrictionStore; use MediaWiki\Revision\RevisionLookup; @@ -24,16 +26,14 @@ use MediaWiki\User\UserEditTracker; use MediaWiki\User\UserGroupManager; use MediaWiki\User\UserIdentity; use MediaWiki\User\UserIdentityUtils; -use ParserFactory; -use ParserOptions; use Psr\Log\LoggerInterface; use stdClass; use StringUtils; use UnexpectedValueException; -use WANObjectCache; use Wikimedia\Diff\Diff; use Wikimedia\Diff\UnifiedDiffFormatter; use Wikimedia\IPUtils; +use Wikimedia\ObjectCache\WANObjectCache; use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\LBFactory; use Wikimedia\Rdbms\SelectQueryBuilder; diff --git a/includes/View/AbuseFilterViewEdit.php b/includes/View/AbuseFilterViewEdit.php index 1d3792b4e..20b14498b 100644 --- a/includes/View/AbuseFilterViewEdit.php +++ b/includes/View/AbuseFilterViewEdit.php @@ -3,7 +3,6 @@ namespace MediaWiki\Extension\AbuseFilter\View; use HtmlArmor; -use IDBAccessObject; use LogicException; use MediaWiki\Context\IContextSource; use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager; @@ -28,6 +27,7 @@ use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\Xml\Xml; use OOUI; use UnexpectedValueException; +use Wikimedia\Rdbms\IDBAccessObject; use Wikimedia\Rdbms\IExpression; use Wikimedia\Rdbms\LBFactory; use Wikimedia\Rdbms\LikeValue; diff --git a/maintenance/AddMissingLoggingEntries.php b/maintenance/AddMissingLoggingEntries.php index 9fc8d55a0..01b142e37 100644 --- a/maintenance/AddMissingLoggingEntries.php +++ b/maintenance/AddMissingLoggingEntries.php @@ -10,9 +10,9 @@ if ( $IP === false ) { require_once "$IP/maintenance/Maintenance.php"; // @codeCoverageIgnoreEnd -use LoggedUpdateMaintenance; use ManualLogEntry; use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseFilter; +use MediaWiki\Maintenance\LoggedUpdateMaintenance; use MediaWiki\User\UserIdentityValue; use Wikimedia\Rdbms\IExpression; use Wikimedia\Rdbms\LikeValue; diff --git a/maintenance/MigrateActorsAF.php b/maintenance/MigrateActorsAF.php index 416736c9f..a06557786 100644 --- a/maintenance/MigrateActorsAF.php +++ b/maintenance/MigrateActorsAF.php @@ -8,7 +8,7 @@ namespace MediaWiki\Extension\AbuseFilter\Maintenance; -use LoggedUpdateMaintenance; +use MediaWiki\Maintenance\LoggedUpdateMaintenance; use MediaWiki\MediaWikiServices; use stdClass; use Wikimedia\Rdbms\IDatabase; diff --git a/maintenance/PurgeOldLogIPData.php b/maintenance/PurgeOldLogIPData.php index 80ed7f27f..a52aeab96 100644 --- a/maintenance/PurgeOldLogIPData.php +++ b/maintenance/PurgeOldLogIPData.php @@ -10,7 +10,7 @@ if ( $IP === false ) { require_once "$IP/maintenance/Maintenance.php"; // @codeCoverageIgnoreEnd -use Maintenance; +use MediaWiki\Maintenance\Maintenance; use MediaWiki\Utils\MWTimestamp; class PurgeOldLogIPData extends Maintenance { diff --git a/maintenance/SearchFilters.php b/maintenance/SearchFilters.php index df991cfc7..62c423cb1 100644 --- a/maintenance/SearchFilters.php +++ b/maintenance/SearchFilters.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\AbuseFilter\Maintenance; -use Maintenance; use MediaWiki\MainConfigNames; +use MediaWiki\Maintenance\Maintenance; use Wikimedia\Rdbms\IExpression; use Wikimedia\Rdbms\LikeValue; diff --git a/maintenance/UpdateVarDumps.php b/maintenance/UpdateVarDumps.php index 45708ee85..24f1932fd 100644 --- a/maintenance/UpdateVarDumps.php +++ b/maintenance/UpdateVarDumps.php @@ -3,12 +3,12 @@ namespace MediaWiki\Extension\AbuseFilter\Maintenance; use ExternalStoreAccess; -use LoggedUpdateMaintenance; use MediaWiki\Extension\AbuseFilter\AbuseFilterServices; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore; use MediaWiki\Json\FormatJson; +use MediaWiki\Maintenance\LoggedUpdateMaintenance; use MediaWiki\MediaWikiServices; use MediaWiki\Title\Title; use UnexpectedValueException; diff --git a/tests/phpunit/AbuseFilterConsequencesTest.php b/tests/phpunit/AbuseFilterConsequencesTest.php index b5ccee501..596948d9b 100644 --- a/tests/phpunit/AbuseFilterConsequencesTest.php +++ b/tests/phpunit/AbuseFilterConsequencesTest.php @@ -1,7 +1,10 @@ setTitle( $title ); $confirmEditHandler->onEditFilterMergedContent( $context, - $this->createMock( \Content::class ), + $this->createMock( Content::class ), $status, '', $this->createMock( User::class ), @@ -48,7 +49,7 @@ class ConfirmEditHandlerTest extends MediaWikiIntegrationTestCase { $captchaConsequence->execute(); $confirmEditHandler->onEditFilterMergedContent( $context, - $this->createMock( \Content::class ), + $this->createMock( Content::class ), $status, '', $this->createMock( User::class ), diff --git a/tests/phpunit/integration/Parser/ParserEquivsetTest.php b/tests/phpunit/integration/Parser/ParserEquivsetTest.php index ebb251514..745f9f143 100644 --- a/tests/phpunit/integration/Parser/ParserEquivsetTest.php +++ b/tests/phpunit/integration/Parser/ParserEquivsetTest.php @@ -22,14 +22,14 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Integration\Parser; -use EmptyBagOStuff; use MediaWiki\Extension\AbuseFilter\AbuseFilterServices; use MediaWiki\Extension\AbuseFilter\Parser\FilterEvaluator; use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; use MediaWikiIntegrationTestCase; -use NullStatsdDataFactory; use Wikimedia\Equivset\Equivset; +use Wikimedia\ObjectCache\EmptyBagOStuff; +use Wikimedia\Stats\NullStatsdDataFactory; /** * Tests that require Equivset, separated from the parser unit tests. diff --git a/tests/phpunit/integration/ProtectedVarsAccessLoggerTest.php b/tests/phpunit/integration/ProtectedVarsAccessLoggerTest.php index f6a241b4c..f5de778cc 100644 --- a/tests/phpunit/integration/ProtectedVarsAccessLoggerTest.php +++ b/tests/phpunit/integration/ProtectedVarsAccessLoggerTest.php @@ -2,11 +2,11 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Integration; -use ExtensionRegistry; use Generator; use MediaWiki\CheckUser\Logging\TemporaryAccountLogger; use MediaWiki\Extension\AbuseFilter\AbuseFilterServices; use MediaWiki\Extension\AbuseFilter\ProtectedVarsAccessLogger; +use MediaWiki\Registration\ExtensionRegistry; use MediaWikiIntegrationTestCase; /** diff --git a/tests/phpunit/unit/BlockAutopromoteStoreTest.php b/tests/phpunit/unit/BlockAutopromoteStoreTest.php index 6be9a5fca..9b01ba090 100644 --- a/tests/phpunit/unit/BlockAutopromoteStoreTest.php +++ b/tests/phpunit/unit/BlockAutopromoteStoreTest.php @@ -2,13 +2,13 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; -use BagOStuff; -use HashBagOStuff; use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore; use MediaWiki\Extension\AbuseFilter\FilterUser; use MediaWiki\User\UserIdentityValue; use MediaWikiUnitTestCase; use Psr\Log\NullLogger; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\ObjectCache\HashBagOStuff; /** * @covers \MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore diff --git a/tests/phpunit/unit/Consequences/Consequence/BuiltinPrioritiesTest.php b/tests/phpunit/unit/Consequences/Consequence/BuiltinPrioritiesTest.php index 2ad756e2c..c9cfbdf9f 100644 --- a/tests/phpunit/unit/Consequences/Consequence/BuiltinPrioritiesTest.php +++ b/tests/phpunit/unit/Consequences/Consequence/BuiltinPrioritiesTest.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Consequences\Consequence; -use BagOStuff; use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Throttle; use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Warn; use MediaWiki\Extension\AbuseFilter\Consequences\Parameters; @@ -11,6 +10,7 @@ use MediaWiki\User\UserEditTracker; use MediaWiki\User\UserFactory; use MediaWikiUnitTestCase; use Psr\Log\NullLogger; +use Wikimedia\ObjectCache\BagOStuff; /** * Test for priorities of builtin ConsequencesDisablerConsequence classes diff --git a/tests/phpunit/unit/Consequences/Consequence/ThrottleTest.php b/tests/phpunit/unit/Consequences/Consequence/ThrottleTest.php index dd5087844..6a5b60ffd 100644 --- a/tests/phpunit/unit/Consequences/Consequence/ThrottleTest.php +++ b/tests/phpunit/unit/Consequences/Consequence/ThrottleTest.php @@ -2,9 +2,7 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Consequences\Consequence; -use BagOStuff; use Generator; -use HashBagOStuff; use InvalidArgumentException; use MediaWiki\Extension\AbuseFilter\ActionSpecifier; use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Throttle; @@ -20,6 +18,8 @@ use MediaWiki\User\UserIdentityValue; use MediaWikiUnitTestCase; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\NullLogger; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\ObjectCache\HashBagOStuff; use Wikimedia\TestingAccessWrapper; /** diff --git a/tests/phpunit/unit/Consequences/ConsequencesFactoryTest.php b/tests/phpunit/unit/Consequences/ConsequencesFactoryTest.php index 0c86f6179..4a979df7e 100644 --- a/tests/phpunit/unit/Consequences/ConsequencesFactoryTest.php +++ b/tests/phpunit/unit/Consequences/ConsequencesFactoryTest.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Consequences; -use HashBagOStuff; use MediaWiki\Block\BlockUserFactory; use MediaWiki\Block\DatabaseBlockStore; use MediaWiki\Config\ServiceOptions; @@ -20,6 +19,7 @@ use MediaWiki\User\UserIdentityUtils; use MediaWikiUnitTestCase; use MessageLocalizer; use Psr\Log\NullLogger; +use Wikimedia\ObjectCache\HashBagOStuff; /** * @group Test diff --git a/tests/phpunit/unit/EditStashCacheTest.php b/tests/phpunit/unit/EditStashCacheTest.php index 5da8b28dd..b1ab168b3 100644 --- a/tests/phpunit/unit/EditStashCacheTest.php +++ b/tests/phpunit/unit/EditStashCacheTest.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; -use HashBagOStuff; use MediaWiki\Extension\AbuseFilter\EditStashCache; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer; @@ -10,8 +9,9 @@ use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; use MediaWiki\Title\TitleValue; use MediaWikiUnitTestCase; -use NullStatsdDataFactory; use Psr\Log\LoggerInterface; +use Wikimedia\ObjectCache\HashBagOStuff; +use Wikimedia\Stats\NullStatsdDataFactory; /** * @covers \MediaWiki\Extension\AbuseFilter\EditStashCache diff --git a/tests/phpunit/unit/EmergencyCacheTest.php b/tests/phpunit/unit/EmergencyCacheTest.php index ef0e9ef42..746de52d4 100644 --- a/tests/phpunit/unit/EmergencyCacheTest.php +++ b/tests/phpunit/unit/EmergencyCacheTest.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; -use HashBagOStuff; use MediaWiki\Extension\AbuseFilter\EmergencyCache; use MediaWikiUnitTestCase; +use Wikimedia\ObjectCache\HashBagOStuff; /** * @covers \MediaWiki\Extension\AbuseFilter\EmergencyCache diff --git a/tests/phpunit/unit/FilterLookupTest.php b/tests/phpunit/unit/FilterLookupTest.php index 15764b9e4..8db8ac539 100644 --- a/tests/phpunit/unit/FilterLookupTest.php +++ b/tests/phpunit/unit/FilterLookupTest.php @@ -4,7 +4,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; use AbuseFilterRowsAndFiltersTestTrait; use Generator; -use HashBagOStuff; use MediaWiki\Extension\AbuseFilter\CentralDBManager; use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException; use MediaWiki\Extension\AbuseFilter\Filter\ClosestFilterVersionNotFoundException; @@ -19,7 +18,8 @@ use MediaWiki\Extension\AbuseFilter\Filter\Specs; use MediaWiki\Extension\AbuseFilter\FilterLookup; use MediaWikiUnitTestCase; use stdClass; -use WANObjectCache; +use Wikimedia\ObjectCache\HashBagOStuff; +use Wikimedia\ObjectCache\WANObjectCache; use Wikimedia\Rdbms\FakeResultWrapper; use Wikimedia\Rdbms\IDatabase; use Wikimedia\Rdbms\ILoadBalancer; diff --git a/tests/phpunit/unit/FilterProfilerTest.php b/tests/phpunit/unit/FilterProfilerTest.php index 3c480bbc9..ed40784c5 100644 --- a/tests/phpunit/unit/FilterProfilerTest.php +++ b/tests/phpunit/unit/FilterProfilerTest.php @@ -2,8 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; -use HashBagOStuff; -use IBufferingStatsdDataFactory; use MediaWiki\Config\ServiceOptions; use MediaWiki\Extension\AbuseFilter\FilterProfiler; use MediaWiki\Title\Title; @@ -11,6 +9,8 @@ use MediaWikiUnitTestCase; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; use TestLogger; +use Wikimedia\ObjectCache\HashBagOStuff; +use Wikimedia\Stats\IBufferingStatsdDataFactory; use Wikimedia\WRStats\BagOStuffStatsStore; use Wikimedia\WRStats\WRStatsFactory; diff --git a/tests/phpunit/unit/FilterRunnerFactoryTest.php b/tests/phpunit/unit/FilterRunnerFactoryTest.php index 63a639707..9e4efc050 100644 --- a/tests/phpunit/unit/FilterRunnerFactoryTest.php +++ b/tests/phpunit/unit/FilterRunnerFactoryTest.php @@ -2,8 +2,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; -use HashBagOStuff; -use IBufferingStatsdDataFactory; use MediaWiki\Config\ServiceOptions; use MediaWiki\Extension\AbuseFilter\AbuseLoggerFactory; use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagger; @@ -24,6 +22,8 @@ use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWikiUnitTestCase; use Psr\Log\NullLogger; +use Wikimedia\ObjectCache\HashBagOStuff; +use Wikimedia\Stats\IBufferingStatsdDataFactory; /** * @group Test diff --git a/tests/phpunit/unit/Hooks/AutoPromoteGroupsHandlerTest.php b/tests/phpunit/unit/Hooks/AutoPromoteGroupsHandlerTest.php index 06508e691..495e2c024 100644 --- a/tests/phpunit/unit/Hooks/AutoPromoteGroupsHandlerTest.php +++ b/tests/phpunit/unit/Hooks/AutoPromoteGroupsHandlerTest.php @@ -2,12 +2,12 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Hooks; -use HashBagOStuff; use MediaWiki\Extension\AbuseFilter\BlockAutopromoteStore; use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesRegistry; use MediaWiki\Extension\AbuseFilter\Hooks\Handlers\AutoPromoteGroupsHandler; use MediaWiki\User\UserIdentityValue; use MediaWikiUnitTestCase; +use Wikimedia\ObjectCache\HashBagOStuff; /** * @covers \MediaWiki\Extension\AbuseFilter\Hooks\Handlers\AutoPromoteGroupsHandler diff --git a/tests/phpunit/unit/Parser/ParserTestCase.php b/tests/phpunit/unit/Parser/ParserTestCase.php index f963dece6..5d7105a12 100644 --- a/tests/phpunit/unit/Parser/ParserTestCase.php +++ b/tests/phpunit/unit/Parser/ParserTestCase.php @@ -22,8 +22,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser; -use EmptyBagOStuff; -use Language; use LanguageEn; use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; use MediaWiki\Extension\AbuseFilter\KeywordsManager; @@ -31,11 +29,13 @@ use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; use MediaWiki\Extension\AbuseFilter\Parser\FilterEvaluator; use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; +use MediaWiki\Language\Language; use MediaWikiUnitTestCase; -use NullStatsdDataFactory; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Wikimedia\Equivset\Equivset; +use Wikimedia\ObjectCache\EmptyBagOStuff; +use Wikimedia\Stats\NullStatsdDataFactory; /** * Helper for parser-related tests diff --git a/tests/phpunit/unit/Parser/RuleCheckerFactoryTest.php b/tests/phpunit/unit/Parser/RuleCheckerFactoryTest.php index 7a31cdb0c..4071f653a 100644 --- a/tests/phpunit/unit/Parser/RuleCheckerFactoryTest.php +++ b/tests/phpunit/unit/Parser/RuleCheckerFactoryTest.php @@ -2,16 +2,16 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser; -use BagOStuff; -use Language; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Parser\FilterEvaluator; use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory; use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; +use MediaWiki\Language\Language; use MediaWikiUnitTestCase; -use NullStatsdDataFactory; use Psr\Log\NullLogger; use Wikimedia\Equivset\Equivset; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\Stats\NullStatsdDataFactory; /** * @group Test diff --git a/tests/phpunit/unit/Parser/SyntaxCheckerTest.php b/tests/phpunit/unit/Parser/SyntaxCheckerTest.php index a3dfcfd51..39d7948b6 100644 --- a/tests/phpunit/unit/Parser/SyntaxCheckerTest.php +++ b/tests/phpunit/unit/Parser/SyntaxCheckerTest.php @@ -22,15 +22,15 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser; -use EmptyBagOStuff; use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; use MediaWiki\Extension\AbuseFilter\KeywordsManager; use MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterTokenizer; use MediaWiki\Extension\AbuseFilter\Parser\AFPTreeParser; use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleException; use MediaWiki\Extension\AbuseFilter\Parser\SyntaxChecker; -use NullStatsdDataFactory; use Psr\Log\NullLogger; +use Wikimedia\ObjectCache\EmptyBagOStuff; +use Wikimedia\Stats\NullStatsdDataFactory; /** * @group Test diff --git a/tests/phpunit/unit/Parser/TokenizerTest.php b/tests/phpunit/unit/Parser/TokenizerTest.php index 2fec95904..b51a8b46f 100644 --- a/tests/phpunit/unit/Parser/TokenizerTest.php +++ b/tests/phpunit/unit/Parser/TokenizerTest.php @@ -22,8 +22,8 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit\Parser; -use HashBagOStuff; use MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterTokenizer; +use Wikimedia\ObjectCache\HashBagOStuff; /** * @group Test diff --git a/tests/phpunit/unit/SpecsFormatterTest.php b/tests/phpunit/unit/SpecsFormatterTest.php index cd8630dc0..363c4c13e 100644 --- a/tests/phpunit/unit/SpecsFormatterTest.php +++ b/tests/phpunit/unit/SpecsFormatterTest.php @@ -3,10 +3,10 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; use Generator; -use Language; use MediaWiki\Extension\AbuseFilter\Filter\AbstractFilter; use MediaWiki\Extension\AbuseFilter\Filter\MutableFilter; use MediaWiki\Extension\AbuseFilter\SpecsFormatter; +use MediaWiki\Language\Language; use MediaWiki\Message\Message; use MediaWikiUnitTestCase; use MessageLocalizer; diff --git a/tests/phpunit/unit/TextExtractorTest.php b/tests/phpunit/unit/TextExtractorTest.php index 7ee7f24d0..d00a8f303 100644 --- a/tests/phpunit/unit/TextExtractorTest.php +++ b/tests/phpunit/unit/TextExtractorTest.php @@ -2,10 +2,11 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; -use Content; use DummyNonTextContent; use Generator; +use MediaWiki\Content\Content; use MediaWiki\Content\TextContent; +use MediaWiki\Content\WikitextContent; use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; use MediaWiki\Extension\AbuseFilter\TextExtractor; use MediaWiki\Page\PageIdentityValue; @@ -15,7 +16,6 @@ use MediaWiki\Revision\RevisionRecord; use MediaWiki\Revision\SlotRecord; use MediaWiki\User\UserIdentity; use MediaWikiUnitTestCase; -use WikitextContent; /** * @group Test diff --git a/tests/phpunit/unit/VariableGenerator/VariableGeneratorFactoryTest.php b/tests/phpunit/unit/VariableGenerator/VariableGeneratorFactoryTest.php index 241f4ca6b..091082fb9 100644 --- a/tests/phpunit/unit/VariableGenerator/VariableGeneratorFactoryTest.php +++ b/tests/phpunit/unit/VariableGenerator/VariableGeneratorFactoryTest.php @@ -11,9 +11,9 @@ use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWiki\User\UserFactory; use MediaWikiUnitTestCase; -use MimeAnalyzer; use RecentChange; use RepoGroup; +use Wikimedia\Mime\MimeAnalyzer; /** * @group Test diff --git a/tests/phpunit/unit/Variables/LazyVariableComputerTest.php b/tests/phpunit/unit/Variables/LazyVariableComputerTest.php index 0cd407dc7..526b28b10 100644 --- a/tests/phpunit/unit/Variables/LazyVariableComputerTest.php +++ b/tests/phpunit/unit/Variables/LazyVariableComputerTest.php @@ -3,7 +3,6 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit; use Generator; -use Language; use LogicException; use MediaWiki\Block\SystemBlock; use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; @@ -12,6 +11,8 @@ use MediaWiki\Extension\AbuseFilter\TextExtractor; use MediaWiki\Extension\AbuseFilter\Variables\LazyLoadedVariable; use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer; use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; +use MediaWiki\Language\Language; +use MediaWiki\Parser\ParserFactory; use MediaWiki\Permissions\PermissionManager; use MediaWiki\Permissions\RestrictionStore; use MediaWiki\Request\WebRequest; @@ -25,10 +26,9 @@ use MediaWiki\User\UserGroupManager; use MediaWiki\User\UserIdentityUtils; use MediaWiki\User\UserIdentityValue; use MediaWikiUnitTestCase; -use ParserFactory; use Psr\Log\NullLogger; use UnexpectedValueException; -use WANObjectCache; +use Wikimedia\ObjectCache\WANObjectCache; use Wikimedia\Rdbms\LBFactory; /**