aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/Preferences.php4
-rw-r--r--includes/preferences/DefaultPreferencesFactory.php4
-rw-r--r--includes/preferences/PreferencesFactory.php6
-rw-r--r--includes/specials/SpecialPreferences.php2
-rw-r--r--includes/specials/forms/PreferencesFormLegacy.php13
-rw-r--r--tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php2
6 files changed, 16 insertions, 15 deletions
diff --git a/includes/Preferences.php b/includes/Preferences.php
index 035b4942404c..c458af0eaba2 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -262,12 +262,12 @@ class Preferences {
* @param IContextSource $context
* @param string $formClass
* @param array $remove Array of items to remove
- * @return PreferencesForm|HTMLForm
+ * @return PreferencesFormLegacy|HTMLForm
*/
public static function getFormObject(
$user,
IContextSource $context,
- $formClass = PreferencesForm::class,
+ $formClass = PreferencesFormLegacy::class,
array $remove = []
) {
$preferencesFactory = self::getDefaultPreferencesFactory();
diff --git a/includes/preferences/DefaultPreferencesFactory.php b/includes/preferences/DefaultPreferencesFactory.php
index 755d108fba92..eb94ff1f66e6 100644
--- a/includes/preferences/DefaultPreferencesFactory.php
+++ b/includes/preferences/DefaultPreferencesFactory.php
@@ -45,7 +45,7 @@ use MWTimestamp;
use OutputPage;
use Parser;
use ParserOptions;
-use PreferencesForm;
+use PreferencesFormLegacy;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\NullLogger;
use Skin;
@@ -1488,7 +1488,7 @@ class DefaultPreferencesFactory implements PreferencesFactory {
public function getForm(
User $user,
IContextSource $context,
- $formClass = PreferencesForm::class,
+ $formClass = PreferencesFormLegacy::class,
array $remove = []
) {
if ( SpecialPreferences::isOouiEnabled( $context ) ) {
diff --git a/includes/preferences/PreferencesFactory.php b/includes/preferences/PreferencesFactory.php
index 685f78caaf6d..478edce85734 100644
--- a/includes/preferences/PreferencesFactory.php
+++ b/includes/preferences/PreferencesFactory.php
@@ -28,8 +28,8 @@ use User;
* A PreferencesFactory is a MediaWiki service that provides the definitions of preferences for a
* given user. These definitions are in the form of an HTMLForm descriptor.
*
- * PreferencesForm (a subclass of HTMLForm) is used to generate the Preferences form, and handles
- * generic submission, CSRF protection, layout and other logic in a reusable manner.
+ * PreferencesFormLegacy (a subclass of HTMLForm) is used to generate the Preferences form, and
+ * handles generic submission, CSRF protection, layout and other logic in a reusable manner.
*
* In order to generate the form, the HTMLForm object needs an array structure detailing the
* form fields available, and that's what this implementations of this interface provide. Each
@@ -62,7 +62,7 @@ interface PreferencesFactory {
public function getForm(
User $user,
IContextSource $contextSource,
- $formClass = \PreferencesForm::class,
+ $formClass = \PreferencesFormLegacy::class,
array $remove = []
);
diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php
index 27b6a07c733a..41ee353a78ab 100644
--- a/includes/specials/SpecialPreferences.php
+++ b/includes/specials/SpecialPreferences.php
@@ -163,7 +163,7 @@ class SpecialPreferences extends SpecialPage {
* Get the preferences form to use.
* @param User $user The user.
* @param IContextSource $context The context.
- * @return PreferencesForm|HTMLForm
+ * @return PreferencesFormLegacy|HTMLForm
*/
protected function getFormObject( $user, IContextSource $context ) {
$preferencesFactory = MediaWikiServices::getInstance()->getPreferencesFactory();
diff --git a/includes/specials/forms/PreferencesFormLegacy.php b/includes/specials/forms/PreferencesFormLegacy.php
index 8193c5a984cb..48bded4e044f 100644
--- a/includes/specials/forms/PreferencesFormLegacy.php
+++ b/includes/specials/forms/PreferencesFormLegacy.php
@@ -144,9 +144,10 @@ class PreferencesFormLegacy extends HTMLForm {
}
}
-// Retain the old class name for backwards compatibility.
-// In the future, this alias will be changed to point to PreferencesFormOOUI.
-class PreferencesForm extends PreferencesFormLegacy {
-}
-// Phan doesn't understand class_alias()?
-// class_alias( PreferencesFormLegacy::class, 'PreferencesForm' );
+/**
+ * Retain the old class name for backwards compatibility.
+ * In the future, this alias will be changed to point to PreferencesFormOOUI.
+ *
+ * @deprecated since 1.32
+ */
+class_alias( PreferencesFormLegacy::class, 'PreferencesForm' );
diff --git a/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php b/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php
index 62ab44c440dc..9a8608f47599 100644
--- a/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php
+++ b/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php
@@ -66,7 +66,7 @@ class DefaultPreferencesFactoryTest extends MediaWikiTestCase {
public function testGetForm() {
$testUser = $this->getTestUser();
$form = $this->getPreferencesFactory()->getForm( $testUser->getUser(), $this->context );
- $this->assertInstanceOf( PreferencesForm::class, $form );
+ $this->assertInstanceOf( PreferencesFormLegacy::class, $form );
$this->assertCount( 5, $form->getPreferenceSections() );
}