From ffc9986a95df87993804c8b86121847dd3bb7961 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Tue, 4 Jul 2023 22:34:57 +0200 Subject: [PATCH] api: Rename php class behind action=titleblacklist titleblacklist is not part of action=query (since a2f5ccd2 back in 2011) and should not follow that naming schema. No class alias as nobody needs to call the class directly Change-Id: If57e5bd9291a894edf42835fed07d37cd8e8abed --- extension.json | 2 +- .../{ApiQueryTitleBlacklist.php => ApiTitleBlacklist.php} | 8 ++++---- ...ryTitleBlacklistTest.php => ApiTitleBlacklistTest.php} | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename includes/Api/{ApiQueryTitleBlacklist.php => ApiTitleBlacklist.php} (94%) rename tests/phpunit/{ApiQueryTitleBlacklistTest.php => ApiTitleBlacklistTest.php} (95%) diff --git a/extension.json b/extension.json index f99a5136..d03501aa 100644 --- a/extension.json +++ b/extension.json @@ -44,7 +44,7 @@ } }, "APIModules": { - "titleblacklist": "MediaWiki\\Extension\\TitleBlacklist\\Api\\ApiQueryTitleBlacklist" + "titleblacklist": "MediaWiki\\Extension\\TitleBlacklist\\Api\\ApiTitleBlacklist" }, "MessagesDirs": { "TitleBlacklist": [ diff --git a/includes/Api/ApiQueryTitleBlacklist.php b/includes/Api/ApiTitleBlacklist.php similarity index 94% rename from includes/Api/ApiQueryTitleBlacklist.php rename to includes/Api/ApiTitleBlacklist.php index 04972a97..c5ed406c 100644 --- a/includes/Api/ApiQueryTitleBlacklist.php +++ b/includes/Api/ApiTitleBlacklist.php @@ -30,15 +30,15 @@ use Title; use Wikimedia\ParamValidator\ParamValidator; /** - * Query module check a title against the blacklist + * Module to check a title against the blacklist * * @ingroup API * @ingroup Extensions */ -class ApiQueryTitleBlacklist extends ApiBase { +class ApiTitleBlacklist extends ApiBase { - public function __construct( $query, $moduleName ) { - parent::__construct( $query, $moduleName, 'tb' ); + public function __construct( $mainModule, $moduleName ) { + parent::__construct( $mainModule, $moduleName, 'tb' ); } public function execute() { diff --git a/tests/phpunit/ApiQueryTitleBlacklistTest.php b/tests/phpunit/ApiTitleBlacklistTest.php similarity index 95% rename from tests/phpunit/ApiQueryTitleBlacklistTest.php rename to tests/phpunit/ApiTitleBlacklistTest.php index c7620a6e..81e40d8b 100644 --- a/tests/phpunit/ApiQueryTitleBlacklistTest.php +++ b/tests/phpunit/ApiTitleBlacklistTest.php @@ -4,9 +4,9 @@ use MediaWiki\Extension\TitleBlacklist\TitleBlacklist; /** * @group medium - * @covers \MediaWiki\Extension\TitleBlacklist\Api\ApiQueryTitleBlacklist + * @covers \MediaWiki\Extension\TitleBlacklist\Api\ApiTitleBlacklist */ -class ApiQueryTitleBlacklistTest extends ApiTestCase { +class ApiTitleBlacklistTest extends ApiTestCase { protected function setUp(): void { parent::setUp();