From b808f7f5595c48b829efec35d7f7bbcb1b5674db Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 10 Dec 2021 13:48:39 -0500 Subject: [PATCH] Make InputBoxHooks::render() non-static This matches modern practice a little better: the InputBoxHooks class can (eventually) contain the service objects needed by this extension and make them available to the hooks. It also avoids the need to explicitly name this class and its namespace. Followup-To: Iaaff18b50619f490a4437be7f4d95845c8e0eedb Change-Id: I07a574eca2d0012e3f7e6172d75cffd34392b1b4 --- includes/InputBoxHooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/InputBoxHooks.php b/includes/InputBoxHooks.php index e5cdf977..d57c0031 100644 --- a/includes/InputBoxHooks.php +++ b/includes/InputBoxHooks.php @@ -48,7 +48,7 @@ class InputBoxHooks implements */ public function onParserFirstCallInit( $parser ) { // Register the hook with the parser - $parser->setHook( 'inputbox', 'MediaWiki\Extension\InputBox\InputBoxHooks::render' ); + $parser->setHook( 'inputbox', [ $this, 'render' ] ); } /** @@ -78,7 +78,7 @@ class InputBoxHooks implements * @param Parser $parser * @return string */ - public static function render( $input, $args, Parser $parser ) { + public function render( $input, $args, Parser $parser ) { // Create InputBox $inputBox = new InputBox( $parser );