From 7e5eceb5a6f731d5daed1aa7a73356402ae7c1b9 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 20 Oct 2024 00:55:03 +0200 Subject: [PATCH] Use namespaced classes Changes to the use statements done automatically via script Change-Id: Iab065a2005acccfe05cc827fdafc7861687d053d --- includes/Api/ApiEchoArticleReminder.php | 2 +- includes/Api/ApiEchoCreateEvent.php | 4 ++-- includes/Api/ApiEchoMarkRead.php | 2 +- includes/Api/ApiEchoMarkSeen.php | 2 +- includes/Api/ApiEchoMute.php | 4 ++-- includes/Api/ApiEchoNotifications.php | 6 +++--- includes/Api/ApiEchoUnreadNotificationPages.php | 6 +++--- includes/CachedList.php | 2 +- includes/ContainmentSet.php | 2 +- includes/Controller/NotificationController.php | 2 +- includes/DataOutputFormatter.php | 2 +- includes/DiscussionParser.php | 8 ++++---- includes/EmailBatch.php | 2 +- includes/ForeignWikiRequest.php | 2 +- includes/Formatters/EchoEditUserTalkPresentationModel.php | 2 +- includes/Formatters/EchoEventDigestFormatter.php | 2 +- includes/Formatters/EchoEventFormatter.php | 2 +- includes/Formatters/EchoEventPresentationModel.php | 2 +- includes/Formatters/EchoHtmlDigestEmailFormatter.php | 2 +- includes/Formatters/EchoHtmlEmailFormatter.php | 2 +- includes/Formatters/EchoMentionPresentationModel.php | 2 +- .../Formatters/EchoMentionStatusPresentationModel.php | 2 +- includes/Formatters/EchoPlainTextDigestEmailFormatter.php | 2 +- includes/Formatters/EchoPresentationModelSection.php | 2 +- includes/Hooks.php | 8 ++++---- includes/Model/Event.php | 2 +- includes/NotifUser.php | 2 +- includes/OnWikiList.php | 2 +- includes/Push/Api/ApiEchoPushSubscriptions.php | 6 +++--- includes/Push/Api/ApiEchoPushSubscriptionsCreate.php | 4 ++-- includes/Push/Api/ApiEchoPushSubscriptionsDelete.php | 6 +++--- includes/SeenTime.php | 4 ++-- maintenance/backfillUnreadWikis.php | 1 + maintenance/generateSampleNotifications.php | 4 ++++ maintenance/processEchoEmailBatch.php | 1 + maintenance/recomputeNotifCounts.php | 1 + maintenance/removeInvalidNotification.php | 1 + maintenance/removeOrphanedEvents.php | 1 + maintenance/updatePerUserBlacklist.php | 1 + scripts/gen-autoload.php | 2 ++ tests/phpunit/Api/ApiEchoCreateEventTest.php | 1 + tests/phpunit/ContainmentSetTest.php | 4 ++-- tests/phpunit/UserLocatorTest.php | 2 +- 43 files changed, 66 insertions(+), 53 deletions(-) diff --git a/includes/Api/ApiEchoArticleReminder.php b/includes/Api/ApiEchoArticleReminder.php index a6527e91a..da684ec44 100644 --- a/includes/Api/ApiEchoArticleReminder.php +++ b/includes/Api/ApiEchoArticleReminder.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications\Api; -use ApiBase; use DateInterval; use DateTime; +use MediaWiki\Api\ApiBase; use MediaWiki\Extension\Notifications\Model\Event; use MediaWiki\Utils\MWTimestamp; use Wikimedia\ParamValidator\ParamValidator; diff --git a/includes/Api/ApiEchoCreateEvent.php b/includes/Api/ApiEchoCreateEvent.php index f5f6a0732..6dc9e3005 100644 --- a/includes/Api/ApiEchoCreateEvent.php +++ b/includes/Api/ApiEchoCreateEvent.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Api; -use ApiBase; -use ApiMain; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; use MediaWiki\Extension\Notifications\Model\Event; use MediaWiki\ParamValidator\TypeDef\TitleDef; use MediaWiki\ParamValidator\TypeDef\UserDef; diff --git a/includes/Api/ApiEchoMarkRead.php b/includes/Api/ApiEchoMarkRead.php index b11fa3628..67c18b91b 100644 --- a/includes/Api/ApiEchoMarkRead.php +++ b/includes/Api/ApiEchoMarkRead.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\Notifications\Api; -use ApiBase; +use MediaWiki\Api\ApiBase; use MediaWiki\Extension\Notifications\AttributeManager; use MediaWiki\Extension\Notifications\Controller\NotificationController; use MediaWiki\Extension\Notifications\DbFactory; diff --git a/includes/Api/ApiEchoMarkSeen.php b/includes/Api/ApiEchoMarkSeen.php index 4c6c8d438..e576d1b91 100644 --- a/includes/Api/ApiEchoMarkSeen.php +++ b/includes/Api/ApiEchoMarkSeen.php @@ -4,7 +4,7 @@ namespace MediaWiki\Extension\Notifications\Api; // This is a GET module, not a POST module, for multi-DC support. See T222851. // Note that this module doesn't write to the database, only to the seentime cache. -use ApiBase; +use MediaWiki\Api\ApiBase; use MediaWiki\Extension\Notifications\SeenTime; use Wikimedia\ParamValidator\ParamValidator; diff --git a/includes/Api/ApiEchoMute.php b/includes/Api/ApiEchoMute.php index 87369e309..789e78383 100644 --- a/includes/Api/ApiEchoMute.php +++ b/includes/Api/ApiEchoMute.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Api; -use ApiBase; -use ApiMain; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; use MediaWiki\Cache\LinkBatchFactory; use MediaWiki\Title\Title; use MediaWiki\User\CentralId\CentralIdLookup; diff --git a/includes/Api/ApiEchoNotifications.php b/includes/Api/ApiEchoNotifications.php index fe98bbad4..5446125e7 100644 --- a/includes/Api/ApiEchoNotifications.php +++ b/includes/Api/ApiEchoNotifications.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications\Api; -use ApiBase; -use ApiQuery; -use ApiQueryBase; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiQuery; +use MediaWiki\Api\ApiQueryBase; use MediaWiki\Config\Config; use MediaWiki\Extension\Notifications\AttributeManager; use MediaWiki\Extension\Notifications\Bundler; diff --git a/includes/Api/ApiEchoUnreadNotificationPages.php b/includes/Api/ApiEchoUnreadNotificationPages.php index 013fe2c3f..3e06926d6 100644 --- a/includes/Api/ApiEchoUnreadNotificationPages.php +++ b/includes/Api/ApiEchoUnreadNotificationPages.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications\Api; -use ApiQuery; -use ApiQueryBase; -use ApiUsageException; +use MediaWiki\Api\ApiQuery; +use MediaWiki\Api\ApiQueryBase; +use MediaWiki\Api\ApiUsageException; use MediaWiki\Extension\Notifications\DbFactory; use MediaWiki\Extension\Notifications\NotifUser; use MediaWiki\Extension\Notifications\Services; diff --git a/includes/CachedList.php b/includes/CachedList.php index 6afc24895..f19ccf988 100644 --- a/includes/CachedList.php +++ b/includes/CachedList.php @@ -3,7 +3,7 @@ namespace MediaWiki\Extension\Notifications; use UnexpectedValueException; -use WANObjectCache; +use Wikimedia\ObjectCache\WANObjectCache; /** * Caches an ContainmentList within WANObjectCache to prevent needing diff --git a/includes/ContainmentSet.php b/includes/ContainmentSet.php index d20489786..0eadd0923 100644 --- a/includes/ContainmentSet.php +++ b/includes/ContainmentSet.php @@ -6,7 +6,7 @@ use BadMethodCallException; use MediaWiki\MediaWikiServices; use MediaWiki\Preferences\MultiUsernameFilter; use MediaWiki\User\User; -use WANObjectCache; +use Wikimedia\ObjectCache\WANObjectCache; /** * Utilizes ContainmentList interface to provide a fluent interface to whitelist/blacklist diff --git a/includes/Controller/NotificationController.php b/includes/Controller/NotificationController.php index c44e24089..22228c0c7 100644 --- a/includes/Controller/NotificationController.php +++ b/includes/Controller/NotificationController.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\Notifications\Controller; -use IDBAccessObject; use InvalidArgumentException; use Iterator; use MapCacheLRU; @@ -24,6 +23,7 @@ use MediaWiki\MediaWikiServices; use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWiki\User\UserIdentity; +use Wikimedia\Rdbms\IDBAccessObject; /** * This class represents the controller for notifications diff --git a/includes/DataOutputFormatter.php b/includes/DataOutputFormatter.php index d82508e78..5cb42f201 100644 --- a/includes/DataOutputFormatter.php +++ b/includes/DataOutputFormatter.php @@ -2,7 +2,6 @@ namespace MediaWiki\Extension\Notifications; -use Language; use MediaWiki\Context\RequestContext; use MediaWiki\Extension\Notifications\Formatters\EchoEventFormatter; use MediaWiki\Extension\Notifications\Formatters\EchoFlyoutFormatter; @@ -10,6 +9,7 @@ use MediaWiki\Extension\Notifications\Formatters\EchoModelFormatter; use MediaWiki\Extension\Notifications\Formatters\SpecialNotificationsFormatter; use MediaWiki\Extension\Notifications\Model\Event; use MediaWiki\Extension\Notifications\Model\Notification; +use MediaWiki\Language\Language; use MediaWiki\Revision\RevisionRecord; use MediaWiki\User\User; use MediaWiki\User\UserIdentity; diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index a6a440df7..f6a819d2f 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -3,12 +3,13 @@ namespace MediaWiki\Extension\Notifications; use Article; -use IDBAccessObject; -use Language; +use MediaWiki\Content\TextContent; use MediaWiki\Context\RequestContext; use MediaWiki\Extension\Notifications\Hooks\HookRunner; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\MediaWikiServices; +use MediaWiki\Parser\ParserOptions; use MediaWiki\Parser\ParserOutput; use MediaWiki\Parser\Sanitizer; use MediaWiki\Revision\RevisionRecord; @@ -16,9 +17,8 @@ use MediaWiki\Revision\SlotRecord; use MediaWiki\Title\Title; use MediaWiki\User\User; use MediaWiki\User\UserNameUtils; -use ParserOptions; use RuntimeException; -use TextContent; +use Wikimedia\Rdbms\IDBAccessObject; abstract class DiscussionParser { private const HEADER_REGEX = '^(==+)\h*([^=].*)\h*\1$'; diff --git a/includes/EmailBatch.php b/includes/EmailBatch.php index 4f7b66dd6..e4ef01b4c 100644 --- a/includes/EmailBatch.php +++ b/includes/EmailBatch.php @@ -3,12 +3,12 @@ namespace MediaWiki\Extension\Notifications; use BatchRowIterator; -use Language; use MailAddress; use MediaWiki\Extension\Notifications\Formatters\EchoHtmlDigestEmailFormatter; use MediaWiki\Extension\Notifications\Formatters\EchoPlainTextDigestEmailFormatter; use MediaWiki\Extension\Notifications\Mapper\EventMapper; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\Languages\LanguageFactory; use MediaWiki\MediaWikiServices; use MediaWiki\User\Options\UserOptionsManager; diff --git a/includes/ForeignWikiRequest.php b/includes/ForeignWikiRequest.php index 00a2850a2..50547f148 100644 --- a/includes/ForeignWikiRequest.php +++ b/includes/ForeignWikiRequest.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications; -use ApiMain; use CentralAuthSessionProvider; use Exception; +use MediaWiki\Api\ApiMain; use MediaWiki\Context\RequestContext; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; diff --git a/includes/Formatters/EchoEditUserTalkPresentationModel.php b/includes/Formatters/EchoEditUserTalkPresentationModel.php index fc57c8d6f..203102c6b 100644 --- a/includes/Formatters/EchoEditUserTalkPresentationModel.php +++ b/includes/Formatters/EchoEditUserTalkPresentationModel.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\MediaWikiServices; use MediaWiki\User\User; diff --git a/includes/Formatters/EchoEventDigestFormatter.php b/includes/Formatters/EchoEventDigestFormatter.php index 38f7933f8..d0246b5be 100644 --- a/includes/Formatters/EchoEventDigestFormatter.php +++ b/includes/Formatters/EchoEventDigestFormatter.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\Message\Message; use MediaWiki\User\User; diff --git a/includes/Formatters/EchoEventFormatter.php b/includes/Formatters/EchoEventFormatter.php index 987af68d3..22b837aec 100644 --- a/includes/Formatters/EchoEventFormatter.php +++ b/includes/Formatters/EchoEventFormatter.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\Logger\LoggerFactory; use MediaWiki\Message\Message; use MediaWiki\User\User; diff --git a/includes/Formatters/EchoEventPresentationModel.php b/includes/Formatters/EchoEventPresentationModel.php index 04d8b095f..99758a008 100644 --- a/includes/Formatters/EchoEventPresentationModel.php +++ b/includes/Formatters/EchoEventPresentationModel.php @@ -4,9 +4,9 @@ namespace MediaWiki\Extension\Notifications\Formatters; use InvalidArgumentException; use JsonSerializable; -use Language; use MediaWiki\Extension\Notifications\Controller\NotificationController; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\MediaWikiServices; use MediaWiki\Message\Message; use MediaWiki\Revision\RevisionRecord; diff --git a/includes/Formatters/EchoHtmlDigestEmailFormatter.php b/includes/Formatters/EchoHtmlDigestEmailFormatter.php index 7336c627f..fc701fb60 100644 --- a/includes/Formatters/EchoHtmlDigestEmailFormatter.php +++ b/includes/Formatters/EchoHtmlDigestEmailFormatter.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; use MediaWiki\Html\Html; +use MediaWiki\Language\Language; use MediaWiki\Parser\Sanitizer; use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\User\User; diff --git a/includes/Formatters/EchoHtmlEmailFormatter.php b/includes/Formatters/EchoHtmlEmailFormatter.php index 9a823b17d..4814cdde8 100644 --- a/includes/Formatters/EchoHtmlEmailFormatter.php +++ b/includes/Formatters/EchoHtmlEmailFormatter.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; use MediaWiki\Html\Html; +use MediaWiki\Language\Language; use MediaWiki\Parser\Sanitizer; use MediaWiki\SpecialPage\SpecialPage; diff --git a/includes/Formatters/EchoMentionPresentationModel.php b/includes/Formatters/EchoMentionPresentationModel.php index 2997b77d1..aa92a2864 100644 --- a/includes/Formatters/EchoMentionPresentationModel.php +++ b/includes/Formatters/EchoMentionPresentationModel.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; use MediaWiki\Extension\Notifications\DiscussionParser; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\Revision\RevisionRecord; use MediaWiki\User\User; diff --git a/includes/Formatters/EchoMentionStatusPresentationModel.php b/includes/Formatters/EchoMentionStatusPresentationModel.php index 8bada6f9f..9aae50b1d 100644 --- a/includes/Formatters/EchoMentionStatusPresentationModel.php +++ b/includes/Formatters/EchoMentionStatusPresentationModel.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\User\User; /** diff --git a/includes/Formatters/EchoPlainTextDigestEmailFormatter.php b/includes/Formatters/EchoPlainTextDigestEmailFormatter.php index 1fe49f70b..154829b98 100644 --- a/includes/Formatters/EchoPlainTextDigestEmailFormatter.php +++ b/includes/Formatters/EchoPlainTextDigestEmailFormatter.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\Notifications\Formatters; -use Language; +use MediaWiki\Language\Language; use MediaWiki\Parser\Sanitizer; use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\User\User; diff --git a/includes/Formatters/EchoPresentationModelSection.php b/includes/Formatters/EchoPresentationModelSection.php index 7a3d7776a..87680b59c 100644 --- a/includes/Formatters/EchoPresentationModelSection.php +++ b/includes/Formatters/EchoPresentationModelSection.php @@ -3,9 +3,9 @@ namespace MediaWiki\Extension\Notifications\Formatters; use BadMethodCallException; -use Language; use MediaWiki\Extension\Notifications\DiscussionParser; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Language\Language; use MediaWiki\Parser\Parser; use MediaWiki\Revision\RevisionRecord; use MediaWiki\Title\Title; diff --git a/includes/Hooks.php b/includes/Hooks.php index 40ec6eae1..785a9719b 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -2,18 +2,16 @@ namespace MediaWiki\Extension\Notifications; -use ApiModuleManager; -use Content; use EmailNotification; -use ExtensionRegistry; -use Language; use LogEntry; use LogicException; use MailAddress; +use MediaWiki\Api\ApiModuleManager; use MediaWiki\Api\Hook\ApiMain__moduleManagerHook; use MediaWiki\Auth\AuthManager; use MediaWiki\Auth\Hook\LocalUserCreatedHook; use MediaWiki\Config\Config; +use MediaWiki\Content\Content; use MediaWiki\DAO\WikiAwareEntity; use MediaWiki\Deferred\DeferredUpdates; use MediaWiki\Deferred\LinksUpdate\LinksTable; @@ -39,6 +37,7 @@ use MediaWiki\Hook\SkinTemplateNavigation__UniversalHook; use MediaWiki\Hook\SpecialMuteModifyFormFieldsHook; use MediaWiki\HookContainer\HookContainer; use MediaWiki\HTMLForm\Field\HTMLCheckMatrix; +use MediaWiki\Language\Language; use MediaWiki\Linker\LinkRenderer; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MainConfigNames; @@ -53,6 +52,7 @@ use MediaWiki\Permissions\PermissionManager; use MediaWiki\Preferences\Hook\GetPreferencesHook; use MediaWiki\Preferences\MultiTitleFilter; use MediaWiki\Preferences\MultiUsernameFilter; +use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\Request\WebRequest; use MediaWiki\ResourceLoader as RL; use MediaWiki\ResourceLoader\Hook\ResourceLoaderRegisterModulesHook; diff --git a/includes/Model/Event.php b/includes/Model/Event.php index 91c1c6ead..e05af9a9e 100644 --- a/includes/Model/Event.php +++ b/includes/Model/Event.php @@ -3,7 +3,6 @@ namespace MediaWiki\Extension\Notifications\Model; use Exception; -use IDBAccessObject; use InvalidArgumentException; use MediaWiki\Extension\Notifications\Bundleable; use MediaWiki\Extension\Notifications\Controller\NotificationController; @@ -20,6 +19,7 @@ use MediaWiki\User\User; use MediaWiki\User\UserIdentity; use RuntimeException; use stdClass; +use Wikimedia\Rdbms\IDBAccessObject; /** * Immutable class to represent an event. diff --git a/includes/NotifUser.php b/includes/NotifUser.php index a10f8872c..3460046b1 100644 --- a/includes/NotifUser.php +++ b/includes/NotifUser.php @@ -15,7 +15,7 @@ use MediaWiki\User\UserFactory; use MediaWiki\User\UserIdentity; use MediaWiki\Utils\MWTimestamp; use MediaWiki\WikiMap\WikiMap; -use WANObjectCache; +use Wikimedia\ObjectCache\WANObjectCache; use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\ReadOnlyMode; diff --git a/includes/OnWikiList.php b/includes/OnWikiList.php index dc72dd928..b7e4b819d 100644 --- a/includes/OnWikiList.php +++ b/includes/OnWikiList.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications; +use MediaWiki\Content\TextContent; use MediaWiki\MediaWikiServices; use MediaWiki\Title\Title; -use TextContent; /** * Implements ContainmentList interface for sourcing a list of items from a wiki diff --git a/includes/Push/Api/ApiEchoPushSubscriptions.php b/includes/Push/Api/ApiEchoPushSubscriptions.php index f0f46e5f3..c8e749015 100644 --- a/includes/Push/Api/ApiEchoPushSubscriptions.php +++ b/includes/Push/Api/ApiEchoPushSubscriptions.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications\Push\Api; -use ApiBase; -use ApiModuleManager; -use ApiUsageException; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiModuleManager; +use MediaWiki\Api\ApiUsageException; use MediaWiki\MediaWikiServices; use Wikimedia\ParamValidator\ParamValidator; diff --git a/includes/Push/Api/ApiEchoPushSubscriptionsCreate.php b/includes/Push/Api/ApiEchoPushSubscriptionsCreate.php index 4e77c2cff..0a3b778e5 100644 --- a/includes/Push/Api/ApiEchoPushSubscriptionsCreate.php +++ b/includes/Push/Api/ApiEchoPushSubscriptionsCreate.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Notifications\Push\Api; -use ApiBase; -use ApiMain; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; use MediaWiki\Extension\Notifications\Push\SubscriptionManager; use MediaWiki\Extension\Notifications\Push\Utils; use MediaWiki\Extension\Notifications\Services; diff --git a/includes/Push/Api/ApiEchoPushSubscriptionsDelete.php b/includes/Push/Api/ApiEchoPushSubscriptionsDelete.php index d41e00d98..7cb66365a 100644 --- a/includes/Push/Api/ApiEchoPushSubscriptionsDelete.php +++ b/includes/Push/Api/ApiEchoPushSubscriptionsDelete.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\Notifications\Push\Api; -use ApiBase; -use ApiMain; -use ApiUsageException; +use MediaWiki\Api\ApiBase; +use MediaWiki\Api\ApiMain; +use MediaWiki\Api\ApiUsageException; use MediaWiki\Extension\Notifications\Push\SubscriptionManager; use MediaWiki\Extension\Notifications\Push\Utils; use MediaWiki\Extension\Notifications\Services; diff --git a/includes/SeenTime.php b/includes/SeenTime.php index d04c5a678..e95e3ce54 100644 --- a/includes/SeenTime.php +++ b/includes/SeenTime.php @@ -2,13 +2,13 @@ namespace MediaWiki\Extension\Notifications; -use BagOStuff; -use CachedBagOStuff; use MediaWiki\Deferred\DeferredUpdates; use MediaWiki\MediaWikiServices; use MediaWiki\User\CentralId\CentralIdLookup; use MediaWiki\User\UserIdentity; use UnexpectedValueException; +use Wikimedia\ObjectCache\BagOStuff; +use Wikimedia\ObjectCache\CachedBagOStuff; /** * A small wrapper around ObjectCache to manage diff --git a/maintenance/backfillUnreadWikis.php b/maintenance/backfillUnreadWikis.php index b32764c85..e0aa3ab43 100644 --- a/maintenance/backfillUnreadWikis.php +++ b/maintenance/backfillUnreadWikis.php @@ -4,6 +4,7 @@ use MediaWiki\Extension\Notifications\AttributeManager; use MediaWiki\Extension\Notifications\DbFactory; use MediaWiki\Extension\Notifications\NotifUser; use MediaWiki\Extension\Notifications\UnreadWikis; +use MediaWiki\Maintenance\Maintenance; use MediaWiki\User\CentralId\CentralIdLookup; use MediaWiki\User\User; use MediaWiki\WikiMap\WikiMap; diff --git a/maintenance/generateSampleNotifications.php b/maintenance/generateSampleNotifications.php index 896c97414..41cf01263 100644 --- a/maintenance/generateSampleNotifications.php +++ b/maintenance/generateSampleNotifications.php @@ -2,11 +2,15 @@ // phpcs:disable Generic.Files.LineLength -- Long html test examples // @phan-file-suppress PhanUndeclaredClassMethod, PhanUndeclaredClassConstant Other extensions used for testing purposes +use MediaWiki\Content\WikitextContent; use MediaWiki\Extension\Notifications\Model\Event; +use MediaWiki\Maintenance\Maintenance; +use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\Revision\RevisionRecord; use MediaWiki\Revision\SlotRecord; use MediaWiki\Title\Title; use MediaWiki\User\User; +use Wikimedia\Rdbms\IDBAccessObject; $IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { diff --git a/maintenance/processEchoEmailBatch.php b/maintenance/processEchoEmailBatch.php index e07c208b5..6f7c0dbbc 100644 --- a/maintenance/processEchoEmailBatch.php +++ b/maintenance/processEchoEmailBatch.php @@ -2,6 +2,7 @@ use MediaWiki\Extension\Notifications\DbFactory; use MediaWiki\Extension\Notifications\EmailBatch; +use MediaWiki\Maintenance\Maintenance; $IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { diff --git a/maintenance/recomputeNotifCounts.php b/maintenance/recomputeNotifCounts.php index eaaee0a80..f1cbf9d71 100644 --- a/maintenance/recomputeNotifCounts.php +++ b/maintenance/recomputeNotifCounts.php @@ -7,6 +7,7 @@ use MediaWiki\Extension\Notifications\DbFactory; use MediaWiki\Extension\Notifications\NotifUser; +use MediaWiki\Maintenance\Maintenance; use MediaWiki\User\User; require_once getenv( 'MW_INSTALL_PATH' ) !== false diff --git a/maintenance/removeInvalidNotification.php b/maintenance/removeInvalidNotification.php index b9b67f9d3..8e29e2dc2 100644 --- a/maintenance/removeInvalidNotification.php +++ b/maintenance/removeInvalidNotification.php @@ -6,6 +6,7 @@ */ use MediaWiki\Extension\Notifications\DbFactory; +use MediaWiki\Maintenance\Maintenance; require_once getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php' diff --git a/maintenance/removeOrphanedEvents.php b/maintenance/removeOrphanedEvents.php index 4b97c34d7..87e1c531f 100644 --- a/maintenance/removeOrphanedEvents.php +++ b/maintenance/removeOrphanedEvents.php @@ -6,6 +6,7 @@ */ use MediaWiki\Extension\Notifications\DbFactory; +use MediaWiki\Maintenance\LoggedUpdateMaintenance; require_once getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php' diff --git a/maintenance/updatePerUserBlacklist.php b/maintenance/updatePerUserBlacklist.php index bb6225655..9dc389b94 100644 --- a/maintenance/updatePerUserBlacklist.php +++ b/maintenance/updatePerUserBlacklist.php @@ -5,6 +5,7 @@ * @ingroup Maintenance */ +use MediaWiki\Maintenance\LoggedUpdateMaintenance; use MediaWiki\User\User; require_once getenv( 'MW_INSTALL_PATH' ) !== false diff --git a/scripts/gen-autoload.php b/scripts/gen-autoload.php index f898fc07f..5d63edde3 100644 --- a/scripts/gen-autoload.php +++ b/scripts/gen-autoload.php @@ -2,6 +2,8 @@ // Keep in sync with same script in Flow. +use MediaWiki\Maintenance\Maintenance; + require_once getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php' : __DIR__ . '/../../../maintenance/Maintenance.php'; diff --git a/tests/phpunit/Api/ApiEchoCreateEventTest.php b/tests/phpunit/Api/ApiEchoCreateEventTest.php index 69bf844b9..9a4fd948e 100644 --- a/tests/phpunit/Api/ApiEchoCreateEventTest.php +++ b/tests/phpunit/Api/ApiEchoCreateEventTest.php @@ -1,5 +1,6 @@