Merge "mediawiki.api: Remove console warning for legacy token type"
[mediawiki.git] / includes / page / Hook / ArticleDeleteHook.php
blob9f542c0342c79f73bccd32390fb440185f4cc1d5
1 <?php
3 namespace MediaWiki\Page\Hook;
5 use MediaWiki\Status\Status;
6 use MediaWiki\User\User;
7 use WikiPage;
9 /**
10 * This is a hook handler interface, see docs/Hooks.md.
11 * Use the hook name "ArticleDelete" to register handlers implementing this interface.
13 * @ingroup Hooks
14 * @deprecated since 1.37, use PageDeleteHook instead. The new hook uses more modern typehints and requires callers
15 * to add errors to $status, rather than the $error parameter.
17 interface ArticleDeleteHook {
18 /**
19 * This hook is called before an article is deleted.
21 * @since 1.35
23 * @param WikiPage $wikiPage WikiPage being deleted
24 * @param User $user User deleting the article
25 * @param string &$reason Reason the article is being deleted
26 * @param string &$error If the deletion was prohibited, the (raw HTML) error message to display
27 * (added in 1.13)
28 * @param Status &$status Modify this to throw an error. Overridden by $error
29 * (added in 1.20)
30 * @param bool $suppress Whether this is a suppression deletion or not (added in 1.27)
31 * @return bool|void True or no return value to continue or false to abort
33 public function onArticleDelete( WikiPage $wikiPage, User $user, &$reason, &$error, Status &$status,
34 $suppress