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 AbuseFilterComputeVariableHook {
|
|
|
|
/**
|
|
|
|
* Hook runner for the `AbuseFilter-computeVariable` hook
|
|
|
|
*
|
|
|
|
* Like AbuseFilter-interceptVariable but called if the requested method wasn't found.
|
|
|
|
* Return true to indicate that the method is known to the hook and was computed successful.
|
|
|
|
*
|
|
|
|
* @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 ?string &$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_computeVariable(
|
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,
|
|
|
|
?string &$result
|
|
|
|
);
|
|
|
|
}
|