From a8019493007e0c56aea9f2fc8ff76b87293be4b2 Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 24 Oct 2024 00:17:17 +0100 Subject: [PATCH] Remove class_alias calls and cleanup Autoloads Existed since 1.39 in I3fa9747e0ea970c5de39e2da8603e1bba9388a69 Change-Id: I17a648aaf7644d00cd82966a88dab8f33d2e317f --- FancyCaptcha/extension.json | 4 ---- QuestyCaptcha/extension.json | 4 ---- extension.json | 6 ------ includes/FancyCaptcha/FancyCaptcha.php | 2 -- includes/Hooks.php | 2 -- includes/QuestyCaptcha/QuestyCaptcha.php | 2 -- includes/Store/CaptchaCacheStore.php | 2 -- tests/phpunit/HTMLFancyCaptchaFieldTest.php | 12 ------------ tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php | 12 ------------ tests/phpunit/QuestyCaptchaTest.php | 10 ---------- .../ReCaptchaNoCaptchaAuthenticationRequestTest.php | 12 ------------ 11 files changed, 68 deletions(-) diff --git a/FancyCaptcha/extension.json b/FancyCaptcha/extension.json index e83e652dd..3c759b310 100644 --- a/FancyCaptcha/extension.json +++ b/FancyCaptcha/extension.json @@ -17,10 +17,6 @@ "i18n/api" ] }, - "AutoloadClasses": { - "FancyCaptcha": "../includes/FancyCaptcha/FancyCaptcha.php", - "MediaWiki\\Extension\\ConfirmEdit\\FancyCaptcha\\FancyCaptcha": "../includes/FancyCaptcha/FancyCaptcha.php" - }, "AutoloadNamespaces": { "MediaWiki\\Extension\\ConfirmEdit\\FancyCaptcha\\": "../includes/FancyCaptcha/" }, diff --git a/QuestyCaptcha/extension.json b/QuestyCaptcha/extension.json index f1fc09a89..b924c60ee 100644 --- a/QuestyCaptcha/extension.json +++ b/QuestyCaptcha/extension.json @@ -12,10 +12,6 @@ "i18n" ] }, - "AutoloadClasses": { - "QuestyCaptcha": "../includes/QuestyCaptcha/QuestyCaptcha.php", - "MediaWiki\\Extension\\ConfirmEdit\\QuestyCaptcha\\QuestyCaptcha": "../includes/QuestyCaptcha/QuestyCaptcha.php" - }, "AutoloadNamespaces": { "MediaWiki\\Extension\\ConfirmEdit\\QuestyCaptcha\\": "../includes/QuestyCaptcha/" }, diff --git a/extension.json b/extension.json index 62d5a1492..02f2156f7 100644 --- a/extension.json +++ b/extension.json @@ -55,12 +55,6 @@ "ExtensionMessagesFiles": { "ConfirmEditAlias": "ConfirmEdit.alias.php" }, - "AutoloadClasses": { - "CaptchaCacheStore": "includes/Store/CaptchaCacheStore.php", - "ConfirmEditHooks": "includes/Hooks.php", - "MediaWiki\\Extension\\ConfirmEdit\\Hooks": "includes/Hooks.php", - "MediaWiki\\Extension\\ConfirmEdit\\Store\\CaptchaCacheStore": "includes/Store/CaptchaCacheStore.php" - }, "AutoloadNamespaces": { "MediaWiki\\Extension\\ConfirmEdit\\": "includes/" }, diff --git a/includes/FancyCaptcha/FancyCaptcha.php b/includes/FancyCaptcha/FancyCaptcha.php index 67f969a28..9f8c58dfe 100644 --- a/includes/FancyCaptcha/FancyCaptcha.php +++ b/includes/FancyCaptcha/FancyCaptcha.php @@ -516,5 +516,3 @@ class FancyCaptcha extends SimpleCaptcha { ] + $formDescriptor['captchaWord']; } } - -class_alias( FancyCaptcha::class, 'FancyCaptcha' ); diff --git a/includes/Hooks.php b/includes/Hooks.php index ce46775a9..1ba47da98 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -349,5 +349,3 @@ class Hooks implements } } - -class_alias( Hooks::class, 'ConfirmEditHooks' ); diff --git a/includes/QuestyCaptcha/QuestyCaptcha.php b/includes/QuestyCaptcha/QuestyCaptcha.php index 965e50353..bf8e27795 100644 --- a/includes/QuestyCaptcha/QuestyCaptcha.php +++ b/includes/QuestyCaptcha/QuestyCaptcha.php @@ -150,5 +150,3 @@ class QuestyCaptcha extends SimpleCaptcha { $formDescriptor['captchaWord']['label-message'] = null; } } - -class_alias( QuestyCaptcha::class, 'QuestyCaptcha' ); diff --git a/includes/Store/CaptchaCacheStore.php b/includes/Store/CaptchaCacheStore.php index 372898fdb..ef60e6a0f 100644 --- a/includes/Store/CaptchaCacheStore.php +++ b/includes/Store/CaptchaCacheStore.php @@ -48,5 +48,3 @@ class CaptchaCacheStore extends CaptchaStore { return false; } } - -class_alias( CaptchaCacheStore::class, 'CaptchaCacheStore' ); diff --git a/tests/phpunit/HTMLFancyCaptchaFieldTest.php b/tests/phpunit/HTMLFancyCaptchaFieldTest.php index 45faf0a87..b2289ba29 100644 --- a/tests/phpunit/HTMLFancyCaptchaFieldTest.php +++ b/tests/phpunit/HTMLFancyCaptchaFieldTest.php @@ -14,18 +14,6 @@ use MediaWiki\Title\Title; */ class HTMLFancyCaptchaFieldTest extends MediaWikiIntegrationTestCase { - public function setUp(): void { - parent::setUp(); - - $this->mergeMwGlobalArrayValue( - 'wgAutoloadClasses', - [ - 'MediaWiki\\Extension\\ConfirmEdit\\FancyCaptcha\\HTMLFancyCaptchaField' - => __DIR__ . '/../../includes/FancyCaptcha/HTMLFancyCaptchaField.php' - ] - ); - } - public function testGetHTML() { $html = $this->getForm( [ 'imageUrl' => 'https://example.com/' ] )->getHTML( false ); $this->assertMatchesRegularExpression( '/"fancycaptcha-image"/', $html ); diff --git a/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php b/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php index 3860c350c..3dbdef167 100644 --- a/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php +++ b/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php @@ -12,18 +12,6 @@ use MediaWiki\Title\Title; */ class HTMLReCaptchaNoCaptchaFieldTest extends MediaWikiIntegrationTestCase { - public function setUp(): void { - parent::setUp(); - - $this->mergeMwGlobalArrayValue( - 'wgAutoloadClasses', - [ - 'MediaWiki\\Extension\\ConfirmEdit\\ReCaptchaNoCaptcha\\HTMLReCaptchaNoCaptchaField' - => __DIR__ . '/../../includes/ReCaptchaNoCaptcha/HTMLReCaptchaNoCaptchaField.php' - ] - ); - } - public function testSubmit() { $request = new FauxRequest( [ 'foo' => 'abc', diff --git a/tests/phpunit/QuestyCaptchaTest.php b/tests/phpunit/QuestyCaptchaTest.php index b8bdff3d3..e35aec42b 100644 --- a/tests/phpunit/QuestyCaptchaTest.php +++ b/tests/phpunit/QuestyCaptchaTest.php @@ -7,16 +7,6 @@ use MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha; */ class QuestyCaptchaTest extends MediaWikiIntegrationTestCase { - public function setUp(): void { - parent::setUp(); - - $this->mergeMwGlobalArrayValue( - 'wgAutoloadClasses', - [ 'MediaWiki\\Extension\\ConfirmEdit\\QuestyCaptcha\\QuestyCaptcha' - => __DIR__ . '/../../includes/QuestyCaptcha/QuestyCaptcha.php' ] - ); - } - /** * @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha::getCaptcha * @dataProvider provideGetCaptcha diff --git a/tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php b/tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php index 5df98d5b5..3ca4969cc 100644 --- a/tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php +++ b/tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php @@ -8,18 +8,6 @@ use MediaWiki\Tests\Auth\AuthenticationRequestTestCase; */ class ReCaptchaNoCaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase { - public function setUp(): void { - parent::setUp(); - - $this->mergeMwGlobalArrayValue( - 'wgAutoloadClasses', - [ - 'MediaWiki\\Extension\\ConfirmEdit\\ReCaptchaNoCaptcha\\ReCaptchaNoCaptchaAuthenticationRequest' - => __DIR__ . '/../..//includes/ReCaptchaNoCaptcha/ReCaptchaNoCaptchaAuthenticationRequest.php' - ] - ); - } - protected function getInstance( array $args = [] ) { return new ReCaptchaNoCaptchaAuthenticationRequest(); }