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:
Matěj Suchánek 2022-07-26 15:47:41 +02:00
parent 5e8d67919d
commit 3914c913e3
2 changed files with 1 additions and 47 deletions

View file

@ -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();
}
}

View file

@ -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.
*