Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 19
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
SpecialTopicSubscriptions
0.00% covered (danger)
0.00%
0 / 19
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 execute
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 1
2
 getDescription
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getGroupName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\DiscussionTools;
4
5use MediaWiki\Exception\ErrorPageError;
6use MediaWiki\Linker\LinkRenderer;
7use MediaWiki\Page\LinkBatchFactory;
8use MediaWiki\Parser\ParserOptions;
9use MediaWiki\SpecialPage\SpecialPage;
10
11class SpecialTopicSubscriptions extends SpecialPage {
12
13    public function __construct(
14        private readonly LinkRenderer $linkRenderer,
15        private readonly LinkBatchFactory $linkBatchFactory,
16        private readonly ThreadItemStore $threadItemStore,
17        private readonly ThreadItemFormatter $threadItemFormatter,
18    ) {
19        parent::__construct( 'TopicSubscriptions' );
20    }
21
22    /**
23     * @inheritDoc
24     * @throws ErrorPageError
25     */
26    public function execute( $subpage ) {
27        $this->requireNamedUser();
28
29        parent::execute( $subpage );
30
31        $this->getOutput()->addModules( [ 'ext.discussionTools.init' ] );
32
33        $this->getOutput()->addHtml( $this->msg( 'discussiontools-topicsubscription-special-intro' )->parseAsBlock() );
34
35        $this->getOutput()->enableOOUI();
36        $pager = new TopicSubscriptionsPager(
37            $this->getContext(),
38            $this->linkRenderer,
39            $this->linkBatchFactory,
40            $this->threadItemStore,
41            $this->threadItemFormatter
42        );
43        $this->getOutput()->addParserOutputContent(
44            $pager->getFullOutput(),
45            ParserOptions::newFromContext( $this->getContext() )
46        );
47    }
48
49    /**
50     * @inheritDoc
51     */
52    public function getDescription() {
53        return $this->msg( 'discussiontools-topicsubscription-special-title' );
54    }
55
56    /**
57     * @inheritDoc
58     */
59    protected function getGroupName() {
60        return 'login';
61    }
62}