diff --git a/includes/Hooks.php b/includes/Hooks.php index 737781ce8..222dcdfe0 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -8,11 +8,11 @@ use MediaWiki\Hook\MakeGlobalVariablesScriptHook; use MediaWiki\Hook\OutputPageBodyAttributesHook; use MediaWiki\MediaWikiServices; use MediaWiki\Preferences\Hook\GetPreferencesHook; +use MediaWiki\ResourceLoader as RL; use MediaWiki\ResourceLoader\Hook\ResourceLoaderSiteModulePagesHook; use MediaWiki\ResourceLoader\Hook\ResourceLoaderSiteStylesModulePagesHook; use MediaWiki\Skins\Hook\SkinPageReadyConfigHook; use OutputPage; -use ResourceLoaderContext; use RuntimeException; use Skin; use SkinTemplate; @@ -86,12 +86,12 @@ class Hooks implements /** * Passes config variables to Vector (modern) ResourceLoader module. - * @param ResourceLoaderContext $context + * @param RL\Context $context * @param Config $config * @return array */ public static function getVectorResourceLoaderConfig( - ResourceLoaderContext $context, + RL\Context $context, Config $config ) { return [ @@ -104,12 +104,12 @@ class Hooks implements * Generates config variables for skins.vector.search Resource Loader module (defined in * skin.json). * - * @param ResourceLoaderContext $context + * @param RL\Context $context * @param Config $config * @return array */ public static function getVectorWvuiSearchResourceLoaderConfig( - ResourceLoaderContext $context, + RL\Context $context, Config $config ): array { $result = $config->get( 'VectorWvuiSearchOptions' ); @@ -125,12 +125,12 @@ class Hooks implements * Replace searchModule provided by skin. * * @since 1.35 - * @param ResourceLoaderContext $context + * @param RL\Context $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, + RL\Context $context, array &$config ): void { // It's better to exit before any additional check @@ -140,7 +140,7 @@ class Hooks implements // Tell the `mediawiki.page.ready` module not to wire up search. // This allows us to use the new Vue implementation. - // ResourceLoaderContext has no knowledge of legacy / modern Vector + // Context has no knowledge of legacy / modern Vector // and from its point of view they are the same thing. // Please see the modules `skins.vector.js` and `skins.vector.legacy.js` // for the wire up of search. diff --git a/includes/ResourceLoader/VectorResourceLoaderUserModule.php b/includes/ResourceLoader/VectorResourceLoaderUserModule.php index afac964dc..e3847e40a 100644 --- a/includes/ResourceLoader/VectorResourceLoaderUserModule.php +++ b/includes/ResourceLoader/VectorResourceLoaderUserModule.php @@ -2,15 +2,14 @@ namespace MediaWiki\Skins\Vector\ResourceLoader; +use MediaWiki\ResourceLoader as RL; use MediaWiki\Skins\Vector\Constants; -use ResourceLoaderContext; -use ResourceLoaderUserModule; -class VectorResourceLoaderUserModule extends ResourceLoaderUserModule { +class VectorResourceLoaderUserModule extends RL\UserModule { /** * @inheritDoc */ - protected function getPages( ResourceLoaderContext $context ) { + protected function getPages( RL\Context $context ) { $skin = $context->getSkin(); $config = $this->getConfig(); $user = $context->getUserObj(); diff --git a/includes/ResourceLoader/VectorResourceLoaderUserStylesModule.php b/includes/ResourceLoader/VectorResourceLoaderUserStylesModule.php index 738ab8556..364ce3fe0 100644 --- a/includes/ResourceLoader/VectorResourceLoaderUserStylesModule.php +++ b/includes/ResourceLoader/VectorResourceLoaderUserStylesModule.php @@ -2,15 +2,14 @@ namespace MediaWiki\Skins\Vector\ResourceLoader; +use MediaWiki\ResourceLoader as RL; use MediaWiki\Skins\Vector\Constants; -use ResourceLoaderContext; -use ResourceLoaderUserStylesModule; -class VectorResourceLoaderUserStylesModule extends ResourceLoaderUserStylesModule { +class VectorResourceLoaderUserStylesModule extends RL\UserStylesModule { /** * @inheritDoc */ - protected function getPages( ResourceLoaderContext $context ) { + protected function getPages( RL\Context $context ) { $skin = $context->getSkin(); $config = $this->getConfig(); $user = $context->getUserObj(); diff --git a/skin.json b/skin.json index 392634f9a..8d65f48e1 100644 --- a/skin.json +++ b/skin.json @@ -21,7 +21,7 @@ "license-name": "GPL-2.0-or-later", "type": "skin", "requires": { - "MediaWiki": ">= 1.38.0" + "MediaWiki": ">= 1.39.0" }, "ValidSkinNames": { "vector-2022": {