Follow-up Ifa346c8a92: LanguageNameUtils: CONSTRUCTOR_OTPIONS, not constructorOptions

Change-Id: I357dddf39834e9eed4b173245033d2f27edab329
This commit is contained in:
James D. Forrester 2019-10-10 16:56:18 -07:00
parent 575f0057b6
commit b83a3e3e3a
4 changed files with 5 additions and 5 deletions

View file

@ -275,7 +275,7 @@ return [
'LanguageNameUtils' => function ( MediaWikiServices $services ) : LanguageNameUtils {
return new LanguageNameUtils( new ServiceOptions(
LanguageNameUtils::$constructorOptions,
LanguageNameUtils::CONSTRUCTOR_OPTIONS,
$services->getMainConfig()
) );
},

View file

@ -78,7 +78,7 @@ class LanguageNameUtils {
*/
private $validCodeCache = [];
public static $constructorOptions = [
public const CONSTRUCTOR_OPTIONS = [
'ExtraLanguageNames',
'UsePigLatinVariant',
];
@ -87,7 +87,7 @@ class LanguageNameUtils {
* @param ServiceOptions $options
*/
public function __construct( ServiceOptions $options ) {
$options->assertRequiredOptions( self::$constructorOptions );
$options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
$this->options = $options;
}

View file

@ -2,7 +2,7 @@
/**
* Use this trait to check that code run by tests accesses every key declared for this class'
* ServiceOptions, e.g., in a $constructorOptions member variable. To use this trait, you need to do
* ServiceOptions, e.g., in a CONSTRUCTOR_OPTIONS member const. To use this trait, you need to do
* two things (other than use-ing it):
*
* 1) Don't use the regular ServiceOptions when constructing your objects, but rather

View file

@ -9,7 +9,7 @@ class LanguageNameUtilsTest extends MediaWikiUnitTestCase {
*/
private static function newObj( array $optionsArray = [] ) : LanguageNameUtils {
return new LanguageNameUtils( new ServiceOptions(
LanguageNameUtils::$constructorOptions,
LanguageNameUtils::CONSTRUCTOR_OPTIONS,
$optionsArray,
[
'ExtraLanguageNames' => [],