wiki.techinc.nl/includes/page/Hook/PageDeleteHook.php
Daimona Eaytoy 377342de86 Deprecate and replace legacy hooks in DeletePage
In both cases the typehints were changed to the new interfaces. For the
ArticleDelete hook, the replacement has no $error param and requires the
caller to set a fatal status if it wants to abort.

Bug: T288758
Change-Id: I9540f6ab2075bcf56bd4fdc79c611c883246cdce
2021-09-16 19:13:35 +02:00

37 lines
1,006 B
PHP

<?php
namespace MediaWiki\Page\Hook;
use MediaWiki\Page\ProperPageIdentity;
use MediaWiki\Permissions\Authority;
use StatusValue;
/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "PageDelete" to register handlers implementing this interface.
*
* @stable to implement
* @ingroup Hooks
*/
interface PageDeleteHook {
/**
* This hook is called before a page is deleted.
*
* @since 1.37
*
* @param ProperPageIdentity $page Page being deleted.
* @param Authority $deleter Who is deleting the page
* @param string $reason Reason the page is being deleted
* @param StatusValue $status Add any error here
* @param bool $suppress Whether this is a suppression deletion or not
* @return bool|void True or no return value to continue; false to abort, which also requires adding
* a fatal error to $status.
*/
public function onPageDelete(
ProperPageIdentity $page,
Authority $deleter,
string $reason,
StatusValue $status,
bool $suppress
);
}