. * * @file * @ingroup Skins */ declare( strict_types=1 ); namespace Citizen\Hooks; use MediaWiki\Skins\Hook\SkinPageReadyConfigHook; use ResourceLoaderContext; /** * Hooks to run relating the skin */ class SkinHooks implements SkinPageReadyConfigHook { /** * SkinPageReadyConfig hook handler * * Replace searchModule provided by skin. * * @since 1.35 * @param ResourceLoaderContext $context * @param mixed[] &$config Associative array of configurable options * @return void This hook must not abort, it must return no value */ public function onSkinPageReadyConfig( ResourceLoaderContext $context, array &$config ): void { // It's better to exit before any additional check if ( $context->getSkin() !== 'citizen' ) { return; } // Tell the `mediawiki.page.ready` module not to wire up search. $config['search'] = false; } }