Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
AbuseFilterHandler | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
onAbuseFilterGenerateVarsForRecentChange | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\StructuredDiscussions\Hooks; |
4 | |
5 | use Flow\Data\Listener\RecentChangesListener; |
6 | use Flow\Hooks; |
7 | use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterGenerateVarsForRecentChangeHook; |
8 | use MediaWiki\Extension\AbuseFilter\VariableGenerator\RCVariableGenerator; |
9 | use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder; |
10 | use MediaWiki\User\User; |
11 | use RecentChange; |
12 | |
13 | class AbuseFilterHandler implements AbuseFilterGenerateVarsForRecentChangeHook { |
14 | /** |
15 | * @inheritDoc |
16 | */ |
17 | public function onAbuseFilterGenerateVarsForRecentChange( |
18 | RCVariableGenerator $generator, |
19 | RecentChange $rc, |
20 | VariableHolder $vars, |
21 | User $contextUser |
22 | ): bool { |
23 | if ( $rc->getAttribute( 'rc_source' ) !== RecentChangesListener::SRC_FLOW ) { |
24 | return false; |
25 | } |
26 | |
27 | Hooks::getAbuseFilter()->generateRecentChangesVars( $rc, $vars, $contextUser ); |
28 | return true; |
29 | } |
30 | } |