2020-06-03 00:43:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter\Hooks;
|
|
|
|
|
2021-01-02 14:01:00 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
|
2020-06-03 00:43:22 +00:00
|
|
|
|
|
|
|
interface AbuseFilterInterceptVariableHook {
|
|
|
|
/**
|
|
|
|
* Hook runner for the `AbuseFilter-interceptVariable` hook
|
|
|
|
*
|
2021-01-02 13:41:31 +00:00
|
|
|
* Called before a lazy-loaded variable is computed to be able to set
|
2020-06-03 00:43:22 +00:00
|
|
|
* it before the core code runs. Return false to make the function return right after.
|
|
|
|
*
|
|
|
|
* @param string $method Method to generate the variable
|
2021-01-02 14:01:00 +00:00
|
|
|
* @param VariableHolder $vars
|
2020-06-03 00:43:22 +00:00
|
|
|
* @param array $parameters Parameters with data to compute the value
|
|
|
|
* @param mixed &$result Result of the computation
|
|
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
|
|
*/
|
2021-03-06 17:18:07 +00:00
|
|
|
public function onAbuseFilter_interceptVariable(
|
2020-06-03 00:43:22 +00:00
|
|
|
string $method,
|
2021-01-02 14:01:00 +00:00
|
|
|
VariableHolder $vars,
|
2020-06-03 00:43:22 +00:00
|
|
|
array $parameters,
|
|
|
|
&$result
|
|
|
|
);
|
|
|
|
}
|