Rename Scribunto_LuaTitleBlacklistLibrary to remove underscore

* Class names should not have underscores
* No class alias is created,
  as there is no usage expected outside of the extension.

Change-Id: I50f1271a773d1045262135c707496a289f6ddf28
This commit is contained in:
Umherirrender 2024-09-24 19:57:22 +02:00
parent d3022c5836
commit 4382b2f8e1
3 changed files with 2 additions and 5 deletions

View file

@ -3,9 +3,6 @@
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
</rule> </rule>
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<exclude-pattern>Scribunto_LuaTitleBlacklistLibrary\.php</exclude-pattern>
</rule>
<file>.</file> <file>.</file>
<arg name="extensions" value="php"/> <arg name="extensions" value="php"/>
<arg name="encoding" value="UTF-8"/> <arg name="encoding" value="UTF-8"/>

View file

@ -5,7 +5,7 @@ namespace MediaWiki\Extension\TitleBlacklist;
use MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase; use MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
class Scribunto_LuaTitleBlacklistLibrary extends LibraryBase { class LuaTitleBlacklistLibrary extends LibraryBase {
public function register() { public function register() {
$lib = [ $lib = [
'test' => [ $this, 'test' ], 'test' => [ $this, 'test' ],

View file

@ -20,7 +20,7 @@ class ScribuntoHooks implements ScribuntoExternalLibrariesHook {
*/ */
public function onScribuntoExternalLibraries( string $engine, array &$extraLibraries ) { public function onScribuntoExternalLibraries( string $engine, array &$extraLibraries ) {
if ( $engine === 'lua' ) { if ( $engine === 'lua' ) {
$extraLibraries['mw.ext.TitleBlacklist'] = Scribunto_LuaTitleBlacklistLibrary::class; $extraLibraries['mw.ext.TitleBlacklist'] = LuaTitleBlacklistLibrary::class;
} }
} }
} }