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.
|
2023-09-04 10:52:35 +00:00
|
|
|
* Return false to indicate that the method is known to the hook and was computed successfully.
|
2020-06-03 00:43:22 +00:00
|
|
|
*
|
|
|
|
* @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
|
|
|
|
);
|
|
|
|
}
|