Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ArchivedPage
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 execute
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 getTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\SecurePoll\Pages;
4
5use MediaWiki\Extension\SecurePoll\SpecialSecurePoll;
6use MediaWiki\Linker\LinkRenderer;
7use Wikimedia\Rdbms\ILoadBalancer;
8
9/**
10 * SecurePoll subpage for archiving past elections
11 */
12class ArchivedPage extends ActionPage {
13    /** @var LinkRenderer */
14    private $linkRenderer;
15    /** @var ILoadBalancer */
16    private $loadBalancer;
17
18    /**
19     * @param SpecialSecurePoll $specialPage
20     * @param LinkRenderer $linkRenderer
21     * @param ILoadBalancer $loadBalancer
22     */
23    public function __construct(
24        SpecialSecurePoll $specialPage,
25        LinkRenderer $linkRenderer,
26        ILoadBalancer $loadBalancer
27    ) {
28        parent::__construct( $specialPage );
29        $this->linkRenderer = $linkRenderer;
30        $this->loadBalancer = $loadBalancer;
31    }
32
33    /**
34     * Execute the subpage.
35     * @param array $params Array of subpage parameters.
36     */
37    public function execute( $params ) {
38        $out = $this->specialPage->getOutput();
39        $out->enableOOUI();
40
41        $out->setPageTitleMsg( $this->msg( 'securepoll-archived-title' ) );
42
43        $pager = new ArchivedPager( $this, $this->linkRenderer, $this->loadBalancer );
44        $out->addWikiMsg( 'securepoll-entry-text' );
45        $out->addParserOutputContent( $pager->getBodyOutput() );
46        $out->addHTML( $pager->getNavigationBar() );
47    }
48
49    public function getTitle() {
50        return $this->specialPage->getPageTitle( 'archived' );
51    }
52}