From 13dfba4f9aef1ef293145d14594a79838ec9cb21 Mon Sep 17 00:00:00 2001 From: Reedy Date: Sun, 1 Jun 2014 18:40:09 +0100 Subject: [PATCH] Rename hook subscriber Swap global function for closure Change-Id: I41a17461546ac76e223db1c2dc5b2be1ff093af8 --- SyntaxHighlight_GeSHi.class.php | 2 +- SyntaxHighlight_GeSHi.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php index 8921fa0b..29611d72 100644 --- a/SyntaxHighlight_GeSHi.class.php +++ b/SyntaxHighlight_GeSHi.class.php @@ -480,7 +480,7 @@ class SyntaxHighlight_GeSHi { * @param $extensionTypes * @return bool */ - public static function hSpecialVersion_GeSHi( &$extensionTypes ) { + public static function extensionTypes( &$extensionTypes ) { global $wgExtensionCredits; self::initialise(); $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION; diff --git a/SyntaxHighlight_GeSHi.php b/SyntaxHighlight_GeSHi.php index d006f261..08b2b2e5 100644 --- a/SyntaxHighlight_GeSHi.php +++ b/SyntaxHighlight_GeSHi.php @@ -60,8 +60,7 @@ $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.clas $wgAutoloadClasses['ResourceLoaderGeSHiModule'] = $dir . 'ResourceLoaderGeSHiModule.php'; $wgAutoloadClasses['ResourceLoaderGeSHiLocalModule'] = $dir . 'ResourceLoaderGeSHiLocalModule.php'; -$wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup'; -$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi'; +$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::extensionTypes'; $wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLoaderRegisterModules'; //if ( defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) { @@ -72,7 +71,6 @@ $wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLo $wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook'; //} - // Module to load MediaWiki:Geshi.css. $wgResourceModules['ext.geshi.local'] = array( 'class' => 'HighlightGeSHilocal' ); // More modules are defined by SyntaxHighlight_GeSHi::resourceLoaderRegisterModules, @@ -91,9 +89,10 @@ $wgSyntaxHighlightModels = array( * Register parser hook * * @param $parser Parser + * @return bool */ -function efSyntaxHighlight_GeSHiSetup( &$parser ) { +$wgHooks['ParserFirstCallInit'][] = function ( &$parser ) { $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); $parser->setHook( 'syntaxhighlight', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); return true; -} +};