mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-27 17:50:06 +00:00
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:
parent
76c52cc96c
commit
7ee79747e8
|
@ -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 ) ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue