mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Remove deprecated static methods
They are unused in Wikimedia code (finally). Change-Id: I74c81d950d992552d3edf184b5eecc46e5e2c567 Depends-On: I62533e21d2bc1a22c3fcba4c7c650ca9d95700ef Depends-On: I95ce9897d89213e358c436135278b729f0adc3a2
This commit is contained in:
parent
5e8d67919d
commit
3914c913e3
|
@ -2,16 +2,6 @@
|
|||
|
||||
namespace MediaWiki\Extension\AbuseFilter;
|
||||
|
||||
use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
|
||||
use RequestContext;
|
||||
use Status;
|
||||
use Title;
|
||||
use User;
|
||||
|
||||
/**
|
||||
* This class contains most of the business logic of AbuseFilter. It consists of
|
||||
* static functions for generic use (mostly utility functions).
|
||||
*/
|
||||
class AbuseFilter {
|
||||
|
||||
/**
|
||||
|
@ -30,40 +20,4 @@ class AbuseFilter {
|
|||
'af_group' => 'afh_group',
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns an associative array of filters which were tripped
|
||||
*
|
||||
* @param VariableHolder $vars
|
||||
* @param Title $title
|
||||
* @return bool[] Map of (filter ID => bool)
|
||||
* @deprecated Since 1.34 This was meant to be internal!
|
||||
* @codeCoverageIgnore Deprecated method
|
||||
*/
|
||||
public static function checkAllFilters(
|
||||
VariableHolder $vars,
|
||||
Title $title
|
||||
) {
|
||||
$user = RequestContext::getMain()->getUser();
|
||||
$runnerFactory = AbuseFilterServices::getFilterRunnerFactory();
|
||||
$runner = $runnerFactory->newRunner( $user, $title, $vars, 'default' );
|
||||
return $runner->checkAllFilters();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param VariableHolder $vars
|
||||
* @param Title $title
|
||||
* @param string $group The filter's group (as defined in $wgAbuseFilterValidGroups)
|
||||
* @param User $user The user performing the action
|
||||
* @return Status
|
||||
* @deprecated Since 1.34 Get a FilterRunner instance and call run() on that, if you really need to.
|
||||
* Or consider resolving the problem at its root, because you shouldn't need to call this manually.
|
||||
* @codeCoverageIgnore Deprecated method
|
||||
*/
|
||||
public static function filterAction(
|
||||
VariableHolder $vars, Title $title, $group, User $user
|
||||
) {
|
||||
$runnerFactory = AbuseFilterServices::getFilterRunnerFactory();
|
||||
$runner = $runnerFactory->newRunner( $user, $title, $vars, $group );
|
||||
return $runner->run();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ interface AbuseFilterFilterActionHook {
|
|||
*
|
||||
* DEPRECATED! Use AbuseFilterAlterVariables instead.
|
||||
*
|
||||
* Allows overwriting of abusefilter variables in AbuseFilter::filterAction just before they're
|
||||
* Allows overwriting of abusefilter variables in FilterRunner::init just before they're
|
||||
* checked against filters. Note that you may specify custom variables in a saner way using other hooks:
|
||||
* AbuseFilter-generateTitleVars, AbuseFilter-generateUserVars and AbuseFilter-generateGenericVars.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue