From 3914c913e3fd200efbd6757e68777891ce4ef832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Tue, 26 Jul 2022 15:47:41 +0200 Subject: [PATCH] Remove deprecated static methods They are unused in Wikimedia code (finally). Change-Id: I74c81d950d992552d3edf184b5eecc46e5e2c567 Depends-On: I62533e21d2bc1a22c3fcba4c7c650ca9d95700ef Depends-On: I95ce9897d89213e358c436135278b729f0adc3a2 --- includes/AbuseFilter.php | 46 ------------------- .../Hooks/AbuseFilterFilterActionHook.php | 2 +- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/includes/AbuseFilter.php b/includes/AbuseFilter.php index 1d1fa226e..12a861fe1 100644 --- a/includes/AbuseFilter.php +++ b/includes/AbuseFilter.php @@ -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(); - } } diff --git a/includes/Hooks/AbuseFilterFilterActionHook.php b/includes/Hooks/AbuseFilterFilterActionHook.php index f129473db..e6e116a1c 100644 --- a/includes/Hooks/AbuseFilterFilterActionHook.php +++ b/includes/Hooks/AbuseFilterFilterActionHook.php @@ -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. *