Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
PermissionChangeLogFormatter | |
0.00% |
0 / 11 |
|
0.00% |
0 / 3 |
30 | |
0.00% |
0 / 1 |
makeRightsList | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
getMessageKey | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
extractParameters | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\CentralAuth\LogFormatter; |
4 | |
5 | use LogFormatter; |
6 | |
7 | /** |
8 | * Handles the following log types: |
9 | * - gblrights/groupprms2 |
10 | */ |
11 | class PermissionChangeLogFormatter extends LogFormatter { |
12 | |
13 | private function makeRightsList( array $ids ): string { |
14 | return $ids !== [] |
15 | ? $this->formatParameterValue( 'list', $ids ) |
16 | : $this->msg( 'rightsnone' )->text(); |
17 | } |
18 | |
19 | /** @inheritDoc */ |
20 | protected function getMessageKey() { |
21 | return 'logentry-gblrights-groupprms2'; |
22 | } |
23 | |
24 | protected function extractParameters() { |
25 | if ( $this->entry->isLegacy() ) { |
26 | return parent::extractParameters(); |
27 | } |
28 | |
29 | [ 'addRights' => $addRights, 'removeRights' => $removeRights ] = $this->entry->getParameters(); |
30 | return [ |
31 | 3 => $this->makeRightsList( $addRights ), |
32 | 4 => $this->makeRightsList( $removeRights ), |
33 | ]; |
34 | } |
35 | |
36 | } |