Avoid using User::getDefaultOption

Remove using of User::getDefaultOption since this method will be hard-deprecated. Now it is soft-deprecated

Bug: T276035
Change-Id: I34a9ece7ee25c8fa85849c9dc8d6634cde53cfe5
This commit is contained in:
vladshapik 2021-03-01 12:44:44 +02:00
parent 76c52cc96c
commit 7ee79747e8

View file

@ -264,8 +264,9 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
if ( $username === 'male' || $username === 'female' ) { if ( $username === 'male' || $username === 'female' ) {
$gender = $username; $gender = $username;
} else { } else {
$userOptionsLookup = MediaWikiServices::getInstance()->getUserOptionsLookup();
// default // default
$gender = User::getDefaultOption( 'gender' ); $gender = $userOptionsLookup->getDefaultOption( 'gender' );
// Check for "User:" prefix // Check for "User:" prefix
$title = Title::newFromText( $username ); $title = Title::newFromText( $username );
@ -286,7 +287,6 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
} }
} }
} }
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable gender always not null
return [ $lang->gender( $gender, $forms ) ]; return [ $lang->gender( $gender, $forms ) ];
} }