Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 20 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
SpecialListDuplicateObjectNames | |
0.00% |
0 / 20 |
|
0.00% |
0 / 4 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getGroupName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDescription | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | /** |
3 | * WikiLambda Special:ListDuplicateObjectNames page |
4 | * |
5 | * @file |
6 | * @ingroup Extensions |
7 | * @copyright 2020– Abstract Wikipedia team; see AUTHORS.txt |
8 | * @license MIT |
9 | */ |
10 | |
11 | namespace MediaWiki\Extension\WikiLambda\Special; |
12 | |
13 | use MediaWiki\MediaWikiServices; |
14 | use MediaWiki\SpecialPage\SpecialPage; |
15 | |
16 | class SpecialListDuplicateObjectNames extends SpecialPage { |
17 | public function __construct() { |
18 | parent::__construct( 'ListDuplicateObjectNames' ); |
19 | } |
20 | |
21 | /** |
22 | * @inheritDoc |
23 | */ |
24 | protected function getGroupName() { |
25 | // Triggers use of message specialpages-group-wikilambda |
26 | return 'wikilambda'; |
27 | } |
28 | |
29 | /** |
30 | * @inheritDoc |
31 | */ |
32 | public function getDescription() { |
33 | return $this->msg( 'wikilambda-special-listduplicateobjectlabels' ); |
34 | } |
35 | |
36 | /** |
37 | * @inheritDoc |
38 | */ |
39 | public function execute( $ignoredSubPage ) { |
40 | $this->setHeaders(); |
41 | $this->outputHeader( 'wikilambda-special-listduplicateobjectlabels-summary' ); |
42 | |
43 | $output = $this->getOutput(); |
44 | |
45 | $output->enableOOUI(); |
46 | |
47 | $output->addModuleStyles( [ 'mediawiki.special' ] ); |
48 | // TODO (T300516): Make this help page. |
49 | $this->addHelpLink( 'Help:Wikifunctions/Duplicate Object labels' ); |
50 | |
51 | // TODO (T362246): Dependency-inject |
52 | $services = MediaWikiServices::getInstance(); |
53 | $pager = new DuplicateObjectLabelsPager( |
54 | $this, |
55 | $this->getLinkRenderer(), |
56 | $services->getLinkBatchFactory(), |
57 | $services->getLanguageNameUtils() |
58 | ); |
59 | |
60 | if ( $pager->getNumRows() === 0 ) { |
61 | $output->addWikiMsg( 'wikilambda-special-listduplicateobjectlabels-empty' ); |
62 | return; |
63 | } |
64 | |
65 | $output->addParserOutputContent( $pager->getFullOutput() ); |
66 | } |
67 | } |