Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
QuestionStoreFactory | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
newFromContextAndStorage | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace GrowthExperiments\HelpPanel; |
4 | |
5 | use MediaWiki\Context\IContextSource; |
6 | use MediaWiki\MediaWikiServices; |
7 | |
8 | class QuestionStoreFactory { |
9 | |
10 | /** |
11 | * @param IContextSource $context |
12 | * @param string $storage |
13 | * @return QuestionStore |
14 | */ |
15 | public static function newFromContextAndStorage( IContextSource $context, $storage ) { |
16 | $services = MediaWikiServices::getInstance(); |
17 | return new QuestionStore( |
18 | $context->getUser(), |
19 | $storage, |
20 | $services->getRevisionStore(), |
21 | $services->getContentLanguage(), |
22 | $services->getUserOptionsManager(), |
23 | $services->getUserOptionsLookup(), |
24 | $services->getJobQueueGroup(), |
25 | $context->getRequest()->wasPosted() |
26 | ); |
27 | } |
28 | |
29 | } |