Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 24 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
UserMergeHandler | |
0.00% |
0 / 24 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
onUserMergeAccountFields | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\AbuseFilter\Hooks\Handlers; |
4 | |
5 | use MediaWiki\Config\Config; |
6 | use MediaWiki\Extension\UserMerge\Hooks\AccountFieldsHook; |
7 | |
8 | class UserMergeHandler implements AccountFieldsHook { |
9 | |
10 | private Config $config; |
11 | |
12 | public function __construct( Config $config ) { |
13 | $this->config = $config; |
14 | } |
15 | |
16 | /** |
17 | * Tables that Extension:UserMerge needs to update |
18 | * |
19 | * @param array[] &$updateFields |
20 | */ |
21 | public function onUserMergeAccountFields( array &$updateFields ) { |
22 | $actorStage = $this->config->get( 'AbuseFilterActorTableSchemaMigrationStage' ); |
23 | $updateFields[] = [ |
24 | 'abuse_filter', |
25 | 'af_user', |
26 | 'af_user_text', |
27 | 'batchKey' => 'af_id', |
28 | 'actorId' => 'af_actor', |
29 | 'actorStage' => $actorStage, |
30 | ]; |
31 | $updateFields[] = [ |
32 | 'abuse_filter_log', |
33 | 'afl_user', |
34 | 'afl_user_text', |
35 | 'batchKey' => 'afl_id', |
36 | ]; |
37 | $updateFields[] = [ |
38 | 'abuse_filter_history', |
39 | 'afh_user', |
40 | 'afh_user_text', |
41 | 'batchKey' => 'afh_id', |
42 | 'actorId' => 'afh_actor', |
43 | 'actorStage' => $actorStage, |
44 | ]; |
45 | } |
46 | |
47 | } |