mediawiki-extensions-Nuke/includes/Hooks/NukeHookRunner.php
thiemowmde 9fb95da819 Modernize the code a little bit
For example:
* Remove redundant PHPDoc blocks that just duplicate existing
  information and aren't needed any more with our current PHPCS
  rule set.
* Add some very obvious type declarations.
* Use ??= where it makes sense.

Change-Id: I5c182cc961c6eeccead79ff49b0376eee2418acf
2024-04-19 15:10:15 +02:00

47 lines
909 B
PHP

<?php
namespace MediaWiki\Extension\Nuke\Hooks;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Title\Title;
/**
* Handle running Nuke's hooks
* @author DannyS712
*/
class NukeHookRunner implements NukeDeletePageHook, NukeGetNewPagesHook {
private HookContainer $hookContainer;
public function __construct( HookContainer $hookContainer ) {
$this->hookContainer = $hookContainer;
}
/**
* @inheritDoc
*/
public function onNukeDeletePage( Title $title, string $reason, bool &$deletionResult ) {
return $this->hookContainer->run(
'NukeDeletePage',
[ $title, $reason, &$deletionResult ]
);
}
/**
* @inheritDoc
*/
public function onNukeGetNewPages(
string $username,
?string $pattern,
?int $namespace,
int $limit,
array &$pages
) {
return $this->hookContainer->run(
'NukeGetNewPages',
[ $username, $pattern, $namespace, $limit, &$pages ]
);
}
}