Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
MessageGroupStatsTableFactory | |
0.00% |
0 / 16 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
newFromContext | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace MediaWiki\Extension\Translate\Statistics; |
5 | |
6 | use IContextSource; |
7 | use MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupReviewStore; |
8 | use MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata; |
9 | use MediaWiki\Linker\LinkRenderer; |
10 | use Wikimedia\Rdbms\ILoadBalancer; |
11 | |
12 | /** |
13 | * Factory class for MessageGroupStatsTable |
14 | * @author Abijeet Patro |
15 | * @license GPL-2.0-or-later |
16 | * @since 2023.02 |
17 | */ |
18 | class MessageGroupStatsTableFactory { |
19 | private ProgressStatsTableFactory $progressStatsTableFactory; |
20 | private ILoadBalancer $loadBalancer; |
21 | private LinkRenderer $linkRenderer; |
22 | private MessageGroupReviewStore $groupReviewStore; |
23 | private MessageGroupMetadata $messageGroupMetadata; |
24 | private bool $haveTranslateWorkflowStates; |
25 | |
26 | public function __construct( |
27 | ProgressStatsTableFactory $progressStatsTableFactory, |
28 | ILoadBalancer $loadBalancer, |
29 | LinkRenderer $linkRenderer, |
30 | MessageGroupReviewStore $groupReviewStore, |
31 | MessageGroupMetadata $messageGroupMetadata, |
32 | bool $haveTranslateWorkflowStates |
33 | ) { |
34 | $this->progressStatsTableFactory = $progressStatsTableFactory; |
35 | $this->loadBalancer = $loadBalancer; |
36 | $this->linkRenderer = $linkRenderer; |
37 | $this->groupReviewStore = $groupReviewStore; |
38 | $this->messageGroupMetadata = $messageGroupMetadata; |
39 | $this->haveTranslateWorkflowStates = $haveTranslateWorkflowStates; |
40 | } |
41 | |
42 | public function newFromContext( IContextSource $contextSource ): MessageGroupStatsTable { |
43 | return new MessageGroupStatsTable( |
44 | $this->progressStatsTableFactory->newFromContext( $contextSource ), |
45 | $this->loadBalancer, |
46 | $this->linkRenderer, |
47 | $contextSource, |
48 | $contextSource->getLanguage(), |
49 | $this->groupReviewStore, |
50 | $this->messageGroupMetadata, |
51 | $this->haveTranslateWorkflowStates |
52 | ); |
53 | } |
54 | } |