3 namespace MediaWiki\Page\Hook
;
5 use MediaWiki\Status\Status
;
6 use MediaWiki\User\User
;
10 * This is a hook handler interface, see docs/Hooks.md.
11 * Use the hook name "ArticleDelete" to register handlers implementing this interface.
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
{
19 * This hook is called before an article is deleted.
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
28 * @param Status &$status Modify this to throw an error. Overridden by $error
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,