Remove PHP 5.3 $this closure workaround

Change-Id: I7f2b71823844e39339811ca4bee316b432b54adb
This commit is contained in:
Umherirrender 2021-05-15 02:03:24 +02:00
parent aecd6b7dda
commit 87e2d2ed18

View file

@ -46,11 +46,10 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
foreach ( $statics as $name ) {
$lib[$name] = [ $this, $name ];
}
$ths = $this;
foreach ( $methods as $name ) {
$lib[$name] = static function () use ( $ths, $name ) {
$lib[$name] = function () use ( $name ) {
$args = func_get_args();
return $ths->languageMethod( $name, $args );
return $this->languageMethod( $name, $args );
};
}
return $this->getEngine()->registerInterface( 'mw.language.lua', $lib );