'LanguageNameUtils' => function ( MediaWikiServices $services ) : LanguageNameUtils {
return new LanguageNameUtils( new ServiceOptions(
- LanguageNameUtils::$constructorOptions,
+ LanguageNameUtils::CONSTRUCTOR_OPTIONS,
$services->getMainConfig()
) );
},
*/
private $validCodeCache = [];
- public static $constructorOptions = [
+ public const CONSTRUCTOR_OPTIONS = [
'ExtraLanguageNames',
'UsePigLatinVariant',
];
* @param ServiceOptions $options
*/
public function __construct( ServiceOptions $options ) {
- $options->assertRequiredOptions( self::$constructorOptions );
+ $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
$this->options = $options;
}
/**
* 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
*/
private static function newObj( array $optionsArray = [] ) : LanguageNameUtils {
return new LanguageNameUtils( new ServiceOptions(
- LanguageNameUtils::$constructorOptions,
+ LanguageNameUtils::CONSTRUCTOR_OPTIONS,
$optionsArray,
[
'ExtraLanguageNames' => [],