Skip to content

Commit

Permalink
Use namespaced classes
Browse files Browse the repository at this point in the history
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I353b5721ff12ad2ad591ed12f865dac256066091
  • Loading branch information
umherirrender committed Oct 20, 2024
1 parent af59250 commit 685b177
Show file tree
Hide file tree
Showing 25 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion maintenance/createOAuthConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

namespace MediaWiki\Extension\OAuth;

use Maintenance;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\OAuth\Backend\Consumer;
use MediaWiki\Extension\OAuth\Backend\Utils;
use MediaWiki\Extension\OAuth\Control\ConsumerSubmitControl;
use MediaWiki\Maintenance\Maintenance;
use MediaWiki\User\User;
use MWRestrictions;

Expand Down
2 changes: 1 addition & 1 deletion maintenance/migrateCentralWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

require_once "$IP/maintenance/Maintenance.php";

use Maintenance;
use MediaWiki\Extension\OAuth\Backend\Consumer;
use MediaWiki\Extension\OAuth\Backend\ConsumerAcceptance;
use MediaWiki\Extension\OAuth\Backend\MWOAuthDAO;
use MediaWiki\Maintenance\Maintenance;
use MediaWiki\MediaWikiServices;

class MigrateCentralWiki extends Maintenance {
Expand Down
1 change: 1 addition & 0 deletions maintenance/migrateCentralWikiLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

require_once "$IP/maintenance/Maintenance.php";

use MediaWiki\Maintenance\Maintenance;
use MediaWiki\MediaWikiServices;
use MediaWiki\Title\Title;
use MediaWiki\WikiMap\WikiMap;
Expand Down
2 changes: 1 addition & 1 deletion maintenance/testOAuthConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace MediaWiki\Extension\OAuth;

use Maintenance;
use MediaWiki\Extension\OAuth\Lib\OAuthConsumer;
use MediaWiki\Extension\OAuth\Lib\OAuthException;
use MediaWiki\Extension\OAuth\Lib\OAuthRequest;
use MediaWiki\Extension\OAuth\Lib\OAuthSignatureMethodHmacSha1;
use MediaWiki\Extension\OAuth\Lib\OAuthSignatureMethodRsaSha1;
use MediaWiki\Maintenance\Maintenance;

/**
* @ingroup Maintenance
Expand Down
4 changes: 2 additions & 2 deletions src/Backend/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@

namespace MediaWiki\Extension\OAuth\Backend;

use FormatJson;
use IDBAccessObject;
use LogicException;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\OAuth\Entity\ClientEntity as OAuth2Client;
use MediaWiki\Json\FormatJson;
use MediaWiki\Linker\Linker;
use MediaWiki\MediaWikiServices;
use MediaWiki\Message\Message;
Expand All @@ -34,6 +33,7 @@
use MediaWiki\WikiMap\WikiMap;
use MWRestrictions;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IDBAccessObject;

/**
* Representation of an OAuth consumer.
Expand Down
4 changes: 2 additions & 2 deletions src/Backend/ConsumerAcceptance.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace MediaWiki\Extension\OAuth\Backend;

use FormatJson;
use IDBAccessObject;
use MediaWiki\Context\IContextSource;
use MediaWiki\Json\FormatJson;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IDBAccessObject;

/**
* (c) Aaron Schulz 2013, GPL
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/MWOAuthDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace MediaWiki\Extension\OAuth\Backend;

use Exception;
use IDBAccessObject;
use LogicException;
use MediaWiki\Context\IContextSource;
use MediaWiki\Logger\LoggerFactory;
Expand All @@ -14,6 +13,7 @@
use Wikimedia\Rdbms\DBError;
use Wikimedia\Rdbms\DBReadOnlyError;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IDBAccessObject;

/**
* (c) Aaron Schulz 2013, GPL
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/MWOAuthDataStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace MediaWiki\Extension\OAuth\Backend;

use BagOStuff;
use InvalidArgumentException;
use MediaWiki\Extension\OAuth\Lib\OAuthConsumer;
use MediaWiki\Extension\OAuth\Lib\OAuthDataStore;
Expand All @@ -11,6 +10,7 @@
use MediaWiki\Message\Message;
use MWCryptRand;
use Psr\Log\LoggerInterface;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Rdbms\IDatabase;

class MWOAuthDataStore extends OAuthDataStore {
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace MediaWiki\Extension\OAuth\Backend;

use BagOStuff;
use MediaWiki\Context\RequestContext;
use MediaWiki\Deferred\AutoCommitUpdate;
use MediaWiki\Deferred\DeferredUpdates;
Expand All @@ -15,6 +14,7 @@
use MediaWiki\User\User;
use MediaWiki\WikiMap\WikiMap;
use MWException;
use Wikimedia\ObjectCache\BagOStuff;
use Wikimedia\Rdbms\IDatabase;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Control/ConsumerAcceptanceSubmitControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

namespace MediaWiki\Extension\OAuth\Control;

use FormatJson;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\OAuth\Backend\Consumer;
use MediaWiki\Extension\OAuth\Backend\ConsumerAcceptance;
use MediaWiki\Extension\OAuth\Backend\MWOAuthException;
use MediaWiki\Extension\OAuth\Backend\Utils;
use MediaWiki\Extension\OAuth\Lib\OAuthException;
use MediaWiki\Extension\OAuth\Repository\AccessTokenRepository;
use MediaWiki\Json\FormatJson;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\IDatabase;
Expand Down
6 changes: 3 additions & 3 deletions src/Control/ConsumerSubmitControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

namespace MediaWiki\Extension\OAuth\Control;

use ApiMessage;
use Composer\Semver\VersionParser;
use Exception;
use ExtensionRegistry;
use FormatJson;
use LogicException;
use ManualLogEntry;
use MediaWiki\Api\ApiMessage;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\Notifications\Model\Event;
use MediaWiki\Extension\OAuth\Backend\Consumer;
Expand All @@ -17,9 +15,11 @@
use MediaWiki\Extension\OAuth\Backend\Utils;
use MediaWiki\Extension\OAuth\Entity\ClientEntity;
use MediaWiki\Extension\OAuth\OAuthServices;
use MediaWiki\Json\FormatJson;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use MediaWiki\Parser\Sanitizer;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
Expand Down
2 changes: 1 addition & 1 deletion src/Control/SubmitControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace MediaWiki\Extension\OAuth\Control;

use ApiMessage;
use LogicException;
use MediaWiki\Api\ApiMessage;
use MediaWiki\Context\ContextSource;
use MediaWiki\Context\IContextSource;
use MediaWiki\HTMLForm\HTMLForm;
Expand Down
2 changes: 1 addition & 1 deletion src/Frontend/OAuthLogFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace MediaWiki\Extension\OAuth\Frontend;

use ExtensionRegistry;
use LogEntry;
use LogFormatter;
use MediaWiki\Linker\Linker;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Message\Message;
use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Title\Title;
use MediaWiki\Title\TitleFactory;
use MediaWiki\User\UserEditTracker;
Expand Down
2 changes: 1 addition & 1 deletion src/Frontend/SpecialPages/SpecialMWOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/

use Firebase\JWT\JWT;
use FormatJson;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\OAuth\Backend\Consumer;
use MediaWiki\Extension\OAuth\Backend\ConsumerAcceptance;
Expand All @@ -38,6 +37,7 @@
use MediaWiki\Extension\OAuth\UserStatementProvider;
use MediaWiki\Html\Html;
use MediaWiki\HTMLForm\HTMLForm;
use MediaWiki\Json\FormatJson;
use MediaWiki\Linker\Linker;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Message\Message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/

use ErrorPageError;
use FormatJson;
use InvalidArgumentException;
use LogEventsList;
use LogPage;
Expand All @@ -37,6 +36,7 @@
use MediaWiki\HTMLForm\Field\HTMLHiddenField;
use MediaWiki\HTMLForm\Field\HTMLRestrictionsField;
use MediaWiki\HTMLForm\HTMLForm;
use MediaWiki\Json\FormatJson;
use MediaWiki\Message\Message;
use MediaWiki\Permissions\GrantsInfo;
use MediaWiki\Permissions\GrantsLocalization;
Expand All @@ -45,12 +45,12 @@
use MediaWiki\Status\Status;
use MediaWiki\User\User;
use MediaWiki\WikiMap\WikiMap;
use MediaWiki\Xml\Xml;
use MWRestrictions;
use PermissionsError;
use stdClass;
use UserBlockedError;
use Wikimedia\Rdbms\IDatabase;
use Xml;

/**
* Page that has registration request form and consumer update form
Expand Down
2 changes: 1 addition & 1 deletion src/Frontend/SpecialPages/SpecialMWOAuthListConsumers.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\User\User;
use MediaWiki\WikiMap\WikiMap;
use MediaWiki\Xml\Xml;
use MWException;
use OOUI\HtmlSnippet;
use PermissionsError;
use stdClass;
use Wikimedia\Rdbms\IDatabase;
use Xml;

/**
* Special page for listing the queue of consumer requests and managing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Status\Status;
use MediaWiki\Title\Title;
use MediaWiki\Xml\Xml;
use MWRestrictions;
use OOUI\HtmlSnippet;
use PermissionsError;
use stdClass;
use Wikimedia\Rdbms\IDatabase;
use Xml;

/**
* Special page for listing the queue of consumer requests and managing
Expand Down
2 changes: 1 addition & 1 deletion src/Frontend/SpecialPages/SpecialMWOAuthManageMyGrants.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace MediaWiki\Extension\OAuth\Frontend\SpecialPages;

use ErrorPageError;
use FormatJson;
use MediaWiki\Context\IContextSource;
use MediaWiki\Extension\OAuth\Backend\Consumer;
use MediaWiki\Extension\OAuth\Backend\ConsumerAcceptance;
Expand All @@ -14,6 +13,7 @@
use MediaWiki\Extension\OAuth\Frontend\Pagers\ManageMyGrantsPager;
use MediaWiki\Extension\OAuth\Frontend\UIUtils;
use MediaWiki\HTMLForm\HTMLForm;
use MediaWiki\Json\FormatJson;
use MediaWiki\MediaWikiServices;
use MediaWiki\Permissions\GrantsInfo;
use MediaWiki\Permissions\GrantsLocalization;
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/CacheRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace MediaWiki\Extension\OAuth\Repository;

use BagOStuff;
use MediaWiki\Extension\OAuth\Backend\Utils;
use Wikimedia\ObjectCache\BagOStuff;

abstract class CacheRepository {

Expand Down
2 changes: 1 addition & 1 deletion src/Rest/Handler/RequestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace MediaWiki\Extension\OAuth\Rest\Handler;

use FormatJson;
use MediaWiki\Extension\OAuth\Repository\ScopeRepository;
use MediaWiki\Json\FormatJson;
use MediaWiki\Rest\LocalizedHttpException;
use MediaWiki\Rest\Validator\Validator;
use MWRestrictions;
Expand Down
2 changes: 1 addition & 1 deletion src/Rest/Handler/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace MediaWiki\Extension\OAuth\Rest\Handler;

use FormatJson;
use GuzzleHttp\Psr7\ServerRequest;
use MediaWiki\Extension\OAuth\Backend\MWOAuthException;
use MediaWiki\Extension\OAuth\ResourceServer;
use MediaWiki\Extension\OAuth\Response;
use MediaWiki\Extension\OAuth\UserStatementProvider;
use MediaWiki\Json\FormatJson;
use MediaWiki\Rest\Handler;
use MediaWiki\Rest\HttpException;
use MWException;
Expand Down
4 changes: 2 additions & 2 deletions src/SessionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace MediaWiki\Extension\OAuth;

use ApiBase;
use ApiMessage;
use Exception;
use GuzzleHttp\Psr7\ServerRequest;
use InvalidArgumentException;
use MediaWiki\Api\ApiBase;
use MediaWiki\Api\ApiMessage;
use MediaWiki\Api\Hook\ApiCheckCanExecuteHook;
use MediaWiki\Context\RequestContext;
use MediaWiki\Extension\OAuth\Backend\Consumer;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Rest/EndpointTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace MediaWiki\Extension\OAuth\Tests\Rest;

use Exception;
use FormatJson;
use GuzzleHttp\Psr7\Uri;
use MediaWiki\Context\RequestContext;
use MediaWiki\Json\FormatJson;
use MediaWiki\Rest\Handler;
use MediaWiki\Rest\HttpException;
use MediaWiki\Rest\RequestData;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Rest/RequestClientEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace MediaWiki\Extension\OAuth\Tests\Rest;

use Exception;
use FormatJson;
use MediaWiki\Extension\OAuth\Rest\Handler\RequestClient;
use MediaWiki\Json\FormatJson;
use MediaWiki\MainConfigNames;
use MediaWiki\Rest\Handler;
use MediaWiki\Rest\ResponseInterface;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Rest/ResetClientSecretEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace MediaWiki\Extension\OAuth\Tests\Rest;

use Exception;
use FormatJson;
use MediaWiki\Extension\OAuth\Backend\Consumer;
use MediaWiki\Extension\OAuth\Backend\Utils;
use MediaWiki\Extension\OAuth\Rest\Handler\ResetClientSecret;
use MediaWiki\Json\FormatJson;
use MediaWiki\MainConfigNames;
use MediaWiki\Rest\Handler;
use MediaWiki\Rest\ResponseInterface;
Expand Down

0 comments on commit 685b177

Please sign in to comment.