Add typehints to three hooks

The handlers for these have been typehinted in AbuseFilter for quite a
long time, but switching to the new system requires removing them, see
If699917c3d2e9e22525c7d0495554e25f6b45125. Note that this change
preserves BC.

Change-Id: I95bb47104ad3dc0a69c812c627ffa631c5dc6ace
This commit is contained in:
Daimona Eaytoy 2020-10-04 17:25:40 +02:00
parent 5b7fdba2b3
commit 0739abc372
4 changed files with 10 additions and 6 deletions

View file

@ -3,8 +3,12 @@
namespace MediaWiki\HookContainer;
use Config;
use IContextSource;
use MediaWiki\Linker\LinkRenderer;
use ResourceLoaderContext;
use Skin;
use SpecialPage;
use Title;
/**
* This class provides an implementation of the core hook interfaces,
@ -1332,7 +1336,7 @@ class HookRunner implements
);
}
public function onContributionsToolLinks( $id, $title, &$tools, $specialPage ) {
public function onContributionsToolLinks( $id, Title $title, array &$tools, SpecialPage $specialPage ) {
return $this->container->run(
'ContributionsToolLinks',
[ $id, $title, &$tools, $specialPage ]
@ -2014,7 +2018,7 @@ class HookRunner implements
);
}
public function onHistoryPageToolLinks( $context, $linkRenderer, &$links ) {
public function onHistoryPageToolLinks( IContextSource $context, LinkRenderer $linkRenderer, array &$links ) {
return $this->container->run(
'HistoryPageToolLinks',
[ $context, $linkRenderer, &$links ]
@ -4039,7 +4043,7 @@ class HookRunner implements
);
}
public function onUndeletePageToolLinks( $context, $linkRenderer, &$links ) {
public function onUndeletePageToolLinks( IContextSource $context, LinkRenderer $linkRenderer, array &$links ) {
return $this->container->run(
'UndeletePageToolLinks',
[ $context, $linkRenderer, &$links ]

View file

@ -23,5 +23,5 @@ interface HistoryPageToolLinksHook {
* @param string[] &$links Array of HTML strings
* @return bool|void True or no return value to continue or false to abort
*/
public function onHistoryPageToolLinks( $context, $linkRenderer, &$links );
public function onHistoryPageToolLinks( IContextSource $context, LinkRenderer $linkRenderer, array &$links );
}

View file

@ -24,5 +24,5 @@ interface UndeletePageToolLinksHook {
* @param string[] &$links Array of HTML strings
* @return bool|void True or no return value to continue or false to abort
*/
public function onUndeletePageToolLinks( $context, $linkRenderer, &$links );
public function onUndeletePageToolLinks( IContextSource $context, LinkRenderer $linkRenderer, array &$links );
}

View file

@ -26,5 +26,5 @@ interface ContributionsToolLinksHook {
* hint against a generic SpecialPage though.
* @return bool|void True or no return value to continue or false to abort
*/
public function onContributionsToolLinks( $id, $title, &$tools, $specialPage );
public function onContributionsToolLinks( $id, Title $title, array &$tools, SpecialPage $specialPage );
}