aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaimona Eaytoy <daimona.wiki@gmail.com>2020-10-04 17:25:40 +0200
committerDaimona Eaytoy <daimona.wiki@gmail.com>2020-10-07 11:20:55 +0000
commit0739abc3728fb6c2fdd4bfcc14ddae1b075669d8 (patch)
tree4c2fb9e800b84bf4495390142dc155a4a8ef96fa
parent5b7fdba2b3bec685024ac03a31bbd23934634822 (diff)
downloadmediawikicore-0739abc3728fb6c2fdd4bfcc14ddae1b075669d8.tar.gz
mediawikicore-0739abc3728fb6c2fdd4bfcc14ddae1b075669d8.zip
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
-rw-r--r--includes/HookContainer/HookRunner.php10
-rw-r--r--includes/actions/Hook/HistoryPageToolLinksHook.php2
-rw-r--r--includes/skins/Hook/UndeletePageToolLinksHook.php2
-rw-r--r--includes/specials/Hook/ContributionsToolLinksHook.php2
4 files changed, 10 insertions, 6 deletions
diff --git a/includes/HookContainer/HookRunner.php b/includes/HookContainer/HookRunner.php
index 5fb633dfc93a..036e0dd518f9 100644
--- a/includes/HookContainer/HookRunner.php
+++ b/includes/HookContainer/HookRunner.php
@@ -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 ]
diff --git a/includes/actions/Hook/HistoryPageToolLinksHook.php b/includes/actions/Hook/HistoryPageToolLinksHook.php
index ba0de65b30b2..dcd4bc90f1d4 100644
--- a/includes/actions/Hook/HistoryPageToolLinksHook.php
+++ b/includes/actions/Hook/HistoryPageToolLinksHook.php
@@ -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 );
}
diff --git a/includes/skins/Hook/UndeletePageToolLinksHook.php b/includes/skins/Hook/UndeletePageToolLinksHook.php
index d465d113f4f3..57f1416c3380 100644
--- a/includes/skins/Hook/UndeletePageToolLinksHook.php
+++ b/includes/skins/Hook/UndeletePageToolLinksHook.php
@@ -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 );
}
diff --git a/includes/specials/Hook/ContributionsToolLinksHook.php b/includes/specials/Hook/ContributionsToolLinksHook.php
index 3db9765cc217..c0c4df17fb43 100644
--- a/includes/specials/Hook/ContributionsToolLinksHook.php
+++ b/includes/specials/Hook/ContributionsToolLinksHook.php
@@ -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 );
}