From 56e062512d246d0513112f11b26dac67bc95dd3b Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 9 Jun 2024 18:58:24 +0200 Subject: [PATCH] Use namespaced classes Changes to the use statements done automatically via script Change-Id: Ib56dd5248012dfdc3490aa82bb00f66f20ae1c84 --- src/Auth/TOTPSecondaryAuthenticationProvider.php | 2 +- src/HTMLForm/IManageForm.php | 2 +- src/HTMLForm/OATHAuthOOUIHTMLForm.php | 4 ++-- src/HTMLForm/TOTPDisableForm.php | 2 +- src/Hook/HookHandler.php | 4 ++-- src/Hook/UpdateTables.php | 2 +- src/IModule.php | 4 ++-- src/Module/TOTP.php | 2 +- src/OATHUserRepository.php | 2 +- src/Special/DisableOATHForUser.php | 4 ++-- src/Special/OATHManage.php | 4 ++-- src/Special/VerifyOATHForUser.php | 2 +- tests/phpunit/Auth/TOTPAuthenticationRequestTest.php | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Auth/TOTPSecondaryAuthenticationProvider.php b/src/Auth/TOTPSecondaryAuthenticationProvider.php index 6f637b57..0791c773 100644 --- a/src/Auth/TOTPSecondaryAuthenticationProvider.php +++ b/src/Auth/TOTPSecondaryAuthenticationProvider.php @@ -24,8 +24,8 @@ use MediaWiki\Auth\AuthenticationResponse; use MediaWiki\Auth\AuthManager; use MediaWiki\Extension\OATHAuth\Module\TOTP; use MediaWiki\MediaWikiServices; +use MediaWiki\Message\Message; use MediaWiki\User\User; -use Message; /** * AuthManager secondary authentication provider for TOTP second-factor authentication. diff --git a/src/HTMLForm/IManageForm.php b/src/HTMLForm/IManageForm.php index 101c8aa9..e5de6cc3 100644 --- a/src/HTMLForm/IManageForm.php +++ b/src/HTMLForm/IManageForm.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\OATHAuth\HTMLForm; -use HTMLForm; +use MediaWiki\HTMLForm\HTMLForm; use MediaWiki\Status\Status; use MediaWiki\Title\Title; use OOUI\Layout; diff --git a/src/HTMLForm/OATHAuthOOUIHTMLForm.php b/src/HTMLForm/OATHAuthOOUIHTMLForm.php index 0746f4fd..01365b9a 100644 --- a/src/HTMLForm/OATHAuthOOUIHTMLForm.php +++ b/src/HTMLForm/OATHAuthOOUIHTMLForm.php @@ -2,17 +2,17 @@ namespace MediaWiki\Extension\OATHAuth\HTMLForm; -use IContextSource; +use MediaWiki\Context\IContextSource; use MediaWiki\Extension\OATHAuth\IModule; use MediaWiki\Extension\OATHAuth\OATHUser; use MediaWiki\Extension\OATHAuth\OATHUserRepository; +use MediaWiki\HTMLForm\OOUIHTMLForm; use MediaWiki\Logger\LoggerFactory; use OOUI\FieldsetLayout; use OOUI\HtmlSnippet; use OOUI\Layout; use OOUI\PanelLayout; use OOUI\Widget; -use OOUIHTMLForm; use Psr\Log\LoggerInterface; abstract class OATHAuthOOUIHTMLForm extends OOUIHTMLForm implements IManageForm { diff --git a/src/HTMLForm/TOTPDisableForm.php b/src/HTMLForm/TOTPDisableForm.php index a235e003..5014433e 100644 --- a/src/HTMLForm/TOTPDisableForm.php +++ b/src/HTMLForm/TOTPDisableForm.php @@ -4,7 +4,7 @@ namespace MediaWiki\Extension\OATHAuth\HTMLForm; use MediaWiki\Extension\OATHAuth\Key\TOTPKey; use MediaWiki\Logger\LoggerFactory; -use Message; +use MediaWiki\Message\Message; use MWException; class TOTPDisableForm extends OATHAuthOOUIHTMLForm { diff --git a/src/Hook/HookHandler.php b/src/Hook/HookHandler.php index 4fb9ec16..86be669b 100644 --- a/src/Hook/HookHandler.php +++ b/src/Hook/HookHandler.php @@ -4,8 +4,10 @@ namespace MediaWiki\Extension\OATHAuth\Hook; use MediaWiki\Auth\AuthenticationRequest; use MediaWiki\Config\Config; +use MediaWiki\Context\RequestContext; use MediaWiki\Extension\OATHAuth\OATHAuth; use MediaWiki\Extension\OATHAuth\OATHUserRepository; +use MediaWiki\Message\Message; use MediaWiki\Permissions\Hook\GetUserPermissionsErrorsHook; use MediaWiki\Permissions\Hook\UserGetRightsHook; use MediaWiki\Permissions\PermissionManager; @@ -17,11 +19,9 @@ use MediaWiki\User\Hook\UserEffectiveGroupsHook; use MediaWiki\User\User; use MediaWiki\User\UserGroupManager; use MediaWiki\User\UserGroupMembership; -use Message; use OOUI\ButtonWidget; use OOUI\HorizontalLayout; use OOUI\LabelWidget; -use RequestContext; class HookHandler implements AuthChangeFormFieldsHook, diff --git a/src/Hook/UpdateTables.php b/src/Hook/UpdateTables.php index 25bc55c8..89a87751 100644 --- a/src/Hook/UpdateTables.php +++ b/src/Hook/UpdateTables.php @@ -2,9 +2,9 @@ namespace MediaWiki\Extension\OATHAuth\Hook; -use DatabaseUpdater; use MediaWiki\Extension\OATHAuth\Maintenance\UpdateForMultipleDevicesSupport; use MediaWiki\Extension\OATHAuth\Maintenance\UpdateTOTPScratchTokensToArray; +use MediaWiki\Installer\DatabaseUpdater; use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; class UpdateTables implements LoadExtensionSchemaUpdatesHook { diff --git a/src/IModule.php b/src/IModule.php index 531f6697..1f2b5806 100644 --- a/src/IModule.php +++ b/src/IModule.php @@ -2,10 +2,10 @@ namespace MediaWiki\Extension\OATHAuth; -use IContextSource; use MediaWiki\Auth\AbstractSecondaryAuthenticationProvider; +use MediaWiki\Context\IContextSource; use MediaWiki\Extension\OATHAuth\HTMLForm\IManageForm; -use Message; +use MediaWiki\Message\Message; interface IModule { /** diff --git a/src/Module/TOTP.php b/src/Module/TOTP.php index 1d066e9c..1e120fe0 100644 --- a/src/Module/TOTP.php +++ b/src/Module/TOTP.php @@ -2,7 +2,7 @@ namespace MediaWiki\Extension\OATHAuth\Module; -use IContextSource; +use MediaWiki\Context\IContextSource; use MediaWiki\Extension\OATHAuth\Auth\TOTPSecondaryAuthenticationProvider; use MediaWiki\Extension\OATHAuth\HTMLForm\IManageForm; use MediaWiki\Extension\OATHAuth\HTMLForm\TOTPDisableForm; diff --git a/src/OATHUserRepository.php b/src/OATHUserRepository.php index ee11be98..edaaab9c 100644 --- a/src/OATHUserRepository.php +++ b/src/OATHUserRepository.php @@ -22,13 +22,13 @@ use BagOStuff; use FormatJson; use InvalidArgumentException; use MediaWiki\Config\ConfigException; +use MediaWiki\Context\RequestContext; use MediaWiki\Extension\OATHAuth\Notifications\Manager; use MediaWiki\User\CentralId\CentralIdLookupFactory; use MediaWiki\User\User; use MWException; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; -use RequestContext; use RuntimeException; use Wikimedia\Rdbms\IConnectionProvider; diff --git a/src/Special/DisableOATHForUser.php b/src/Special/DisableOATHForUser.php index c4a625ac..2ff7270d 100644 --- a/src/Special/DisableOATHForUser.php +++ b/src/Special/DisableOATHForUser.php @@ -2,15 +2,15 @@ namespace MediaWiki\Extension\OATHAuth\Special; -use HTMLForm; use ManualLogEntry; use MediaWiki\Config\ConfigException; use MediaWiki\Extension\OATHAuth\OATHUserRepository; +use MediaWiki\HTMLForm\HTMLForm; use MediaWiki\Logger\LoggerFactory; +use MediaWiki\Message\Message; use MediaWiki\SpecialPage\FormSpecialPage; use MediaWiki\User\User; use MediaWiki\User\UserFactory; -use Message; use MWException; use UserBlockedError; use UserNotLoggedIn; diff --git a/src/Special/OATHManage.php b/src/Special/OATHManage.php index 9ff34c2b..65e7e686 100644 --- a/src/Special/OATHManage.php +++ b/src/Special/OATHManage.php @@ -19,7 +19,6 @@ namespace MediaWiki\Extension\OATHAuth\Special; -use HTMLForm; use MediaWiki\Config\ConfigException; use MediaWiki\Extension\OATHAuth\HTMLForm\IManageForm; use MediaWiki\Extension\OATHAuth\IModule; @@ -27,8 +26,9 @@ use MediaWiki\Extension\OATHAuth\OATHAuthModuleRegistry; use MediaWiki\Extension\OATHAuth\OATHUser; use MediaWiki\Extension\OATHAuth\OATHUserRepository; use MediaWiki\Html\Html; +use MediaWiki\HTMLForm\HTMLForm; +use MediaWiki\Message\Message; use MediaWiki\SpecialPage\SpecialPage; -use Message; use MWException; use OOUI\ButtonWidget; use OOUI\HorizontalLayout; diff --git a/src/Special/VerifyOATHForUser.php b/src/Special/VerifyOATHForUser.php index 209e2e2f..0d95caf1 100644 --- a/src/Special/VerifyOATHForUser.php +++ b/src/Special/VerifyOATHForUser.php @@ -2,10 +2,10 @@ namespace MediaWiki\Extension\OATHAuth\Special; -use HTMLForm; use ManualLogEntry; use MediaWiki\Config\ConfigException; use MediaWiki\Extension\OATHAuth\OATHUserRepository; +use MediaWiki\HTMLForm\HTMLForm; use MediaWiki\Logger\LoggerFactory; use MediaWiki\SpecialPage\FormSpecialPage; use MediaWiki\User\UserFactory; diff --git a/tests/phpunit/Auth/TOTPAuthenticationRequestTest.php b/tests/phpunit/Auth/TOTPAuthenticationRequestTest.php index c970641a..acee1458 100644 --- a/tests/phpunit/Auth/TOTPAuthenticationRequestTest.php +++ b/tests/phpunit/Auth/TOTPAuthenticationRequestTest.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\OATHAuth\Tests\Auth; -use MediaWiki\Auth\AuthenticationRequestTestCase; use MediaWiki\Extension\OATHAuth\Auth\TOTPAuthenticationRequest; +use MediaWiki\Tests\Auth\AuthenticationRequestTestCase; /** * @covers \MediaWiki\Extension\OATHAuth\Auth\TOTPAuthenticationRequest