Go to file
Daimona Eaytoy 904d9cddbb Represent Consequences with command objects
The consequence-taking logic is moved away from AbuseFilterRunner, to
dedicated classes. There's now one class per consequence, encapsulating
everything it needs to take the consequence.

Several interfaces allow customizing different types of consequences.
Every "special check" in AbuseFilter was generalized to use these
interfaces, rather than knowing how to handle each consequence.

Adding more consequences from other extensions will also be easier, and
it should happen via a hook (not a global), returning a class that
implements Consequence. The BCConsequence class was temporarily added
for legacy custom consequences.

A ConsequenceFactory class is added to instantiate consequences; this
would possibly benefit from using ObjectFactory, but it doesn't because
it would also reduce readability (although we might do that in the
future).

These classes are still not covered by unit tests, and this is left to
do for later. The new unit tests should mostly replace
AbuseFilterConsequencesTest. @covers tag were added to keep the status
quo (i.e. code that was considered covered while in AbuseFilterRunner
will still be considered covered), although we'll have to adjust them.

Change-Id: Ia1a9a8bbf55ddd875dfd5bbc55fcd612cff568ef
2020-11-25 17:35:36 +00:00
.phan Integrate with Renameuser 2020-10-01 08:10:22 +00:00
db_patches Merge "Actually apply patch-afl_change_deleted_patrolled." 2020-10-05 08:15:48 +00:00
i18n Localisation updates from https://translatewiki.net. 2020-11-25 08:33:15 +01:00
includes Represent Consequences with command objects 2020-11-25 17:35:36 +00:00
maintenance Merge "Add a service to retrieve the filter user" 2020-10-29 09:52:56 +00:00
modules Merge "ViewEdit: avoid linebreaks in form labels" 2020-10-14 15:29:02 +00:00
tests Represent Consequences with command objects 2020-11-25 17:35:36 +00:00
.eslintrc.json eslint config tweaks 2020-06-09 19:39:03 +01:00
.gitignore Add config for Selenium and basic tests 2019-09-17 16:23:07 +00:00
.gitreview Whoops, track not trace 2016-10-24 17:01:30 -07:00
.phpcs.xml Remove exclusions for new PHPCS rules, bump PHPCS to 33.0.0 2020-11-03 19:26:11 +00:00
.stylelintrc.json build: Bump devDependencies to latest 2018-02-10 21:00:53 +00:00
AbuseFilter.alias.php Add aliases for Serbian language 2018-12-24 02:16:55 +00:00
abusefilter.tables.pg.sql Actually apply patch-afl_change_deleted_patrolled. 2020-09-21 14:52:22 +00:00
abusefilter.tables.sql Actually apply patch-afl_change_deleted_patrolled. 2020-09-21 14:52:22 +00:00
abusefilter.tables.sqlite.sql Actually apply patch-afl_change_deleted_patrolled. 2020-09-21 14:52:22 +00:00
CODE_OF_CONDUCT.md build: Updating mediawiki/phan-taint-check-plugin to 1.4.0 2018-09-01 05:29:54 +00:00
composer.json build: Updating mediawiki/mediawiki-phan-config to 0.10.4 2020-11-19 20:33:25 +00:00
COPYING Add COPYING 2014-01-22 21:21:10 +00:00
extension.json Represent Consequences with command objects 2020-11-25 17:35:36 +00:00
Gruntfile.js eslint config tweaks 2020-06-09 19:39:03 +01:00
hooks.txt Replace $wgAbuseFilterRestrictions with more specific variables 2020-10-22 13:38:59 +00:00
package-lock.json build: Updating npm dependencies 2020-11-21 19:38:27 +00:00
package.json build: Updating npm dependencies 2020-11-21 19:38:27 +00:00