Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
HelpdeskQuestionPoster
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 4
30
0.00% covered (danger)
0.00%
0 / 1
 getTag
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSectionHeaderTemplate
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
6
 getDirectTargetTitle
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 getQuestionStoragePref
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace GrowthExperiments\HelpPanel\QuestionPoster;
4
5use GrowthExperiments\GrowthExperimentsServices;
6use GrowthExperiments\HelpPanel;
7use MediaWiki\Config\ConfigException;
8use MediaWiki\MediaWikiServices;
9
10/**
11 * QuestionPoster variant for asking questions on the wiki's help desk.
12 */
13class HelpdeskQuestionPoster extends QuestionPoster {
14
15    public const QUESTION_PREF = 'growthexperiments-helppanel-questions';
16
17    /**
18     * @inheritDoc
19     */
20    protected function getTag() {
21        return HelpPanel::HELPDESK_QUESTION_TAG;
22    }
23
24    /**
25     * @inheritDoc
26     */
27    protected function getSectionHeaderTemplate() {
28        return $this->getWikitextLinkTarget() ?
29            $this->getContext()
30                ->msg( 'growthexperiments-help-panel-question-subject-template-with-title' )
31                ->params( $this->getWikitextLinkTarget() )
32                ->inContentLanguage()->text() :
33            $this->getContext()
34                ->msg( 'growthexperiments-help-panel-question-subject-template' )
35                ->inContentLanguage()->text();
36    }
37
38    /**
39     * @inheritDoc
40     * @throws ConfigException
41     */
42    protected function getDirectTargetTitle() {
43        return HelpPanel::getHelpDeskTitle(
44            GrowthExperimentsServices::wrap( MediaWikiServices::getInstance() )
45                ->getGrowthWikiConfig()
46            );
47    }
48
49    /**
50     * @inheritDoc
51     */
52    protected function getQuestionStoragePref() {
53        return self::QUESTION_PREF;
54    }
55}