Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
97.30% |
36 / 37 |
|
97.30% |
36 / 37 |
CRAP | |
0.00% |
0 / 1 |
Services | |
97.30% |
36 / 37 |
|
97.30% |
36 / 37 |
37 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getInstance | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
get | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
has | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getConfigHelper | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getCsvTranslationImporter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getEntitySearch | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getExternalMessageSourceStateComparator | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getExternalMessageSourceStateImporter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getFileFormatFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getGroupSynchronizationCache | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getHookRunner | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMessageBundleStore | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMessageIndex | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMessageGroupReviewStore | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMessageGroupStatsTableFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMessageGroupSubscription | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMessageGroupSubscriptionHookHandler | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getParsingPlaceholderFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPersistentCache | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getProgressStatsTableFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getRevTagStore | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatableBundleExporter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatableBundleImporter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatableBundleFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatableBundleMover | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatableBundleStatusStore | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatablePageMarker | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatablePageParser | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatablePageStore | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMessageGroupMetadata | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslateSandbox | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslationStashReader | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslationStatsDataProvider | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslationUnitStoreFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTranslatorActivity | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTtmServerFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace MediaWiki\Extension\Translate; |
5 | |
6 | use MediaWiki\Extension\Translate\Cache\PersistentCache; |
7 | use MediaWiki\Extension\Translate\FileFormatSupport\FileFormatFactory; |
8 | use MediaWiki\Extension\Translate\MessageBundleTranslation\MessageBundleStore; |
9 | use MediaWiki\Extension\Translate\MessageGroupProcessing\CsvTranslationImporter; |
10 | use MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupReviewStore; |
11 | use MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription; |
12 | use MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscriptionHookHandler; |
13 | use MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore; |
14 | use MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleExporter; |
15 | use MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleFactory; |
16 | use MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter; |
17 | use MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleStatusStore; |
18 | use MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatablePageStore; |
19 | use MediaWiki\Extension\Translate\MessageLoading\MessageIndex; |
20 | use MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata; |
21 | use MediaWiki\Extension\Translate\PageTranslation\TranslatableBundleMover; |
22 | use MediaWiki\Extension\Translate\PageTranslation\TranslatablePageMarker; |
23 | use MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser; |
24 | use MediaWiki\Extension\Translate\PageTranslation\TranslationUnitStoreFactory; |
25 | use MediaWiki\Extension\Translate\Statistics\MessageGroupStatsTableFactory; |
26 | use MediaWiki\Extension\Translate\Statistics\ProgressStatsTableFactory; |
27 | use MediaWiki\Extension\Translate\Statistics\TranslationStatsDataProvider; |
28 | use MediaWiki\Extension\Translate\Statistics\TranslatorActivity; |
29 | use MediaWiki\Extension\Translate\Synchronization\ExternalMessageSourceStateComparator; |
30 | use MediaWiki\Extension\Translate\Synchronization\ExternalMessageSourceStateImporter; |
31 | use MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache; |
32 | use MediaWiki\Extension\Translate\TranslatorInterface\EntitySearch; |
33 | use MediaWiki\Extension\Translate\TranslatorSandbox\TranslateSandbox; |
34 | use MediaWiki\Extension\Translate\TranslatorSandbox\TranslationStashReader; |
35 | use MediaWiki\Extension\Translate\TtmServer\TtmServerFactory; |
36 | use MediaWiki\Extension\Translate\Utilities\ConfigHelper; |
37 | use MediaWiki\Extension\Translate\Utilities\ParsingPlaceholderFactory; |
38 | use MediaWiki\MediaWikiServices; |
39 | use Psr\Container\ContainerInterface; |
40 | |
41 | /** |
42 | * Minimal service container. |
43 | * |
44 | * Main purpose is to give type-hinted getters for services defined in this extension. |
45 | * |
46 | * @author Niklas Laxström |
47 | * @license GPL-2.0-or-later |
48 | * @since 2020.04 |
49 | */ |
50 | class Services implements ContainerInterface { |
51 | /** @var ContainerInterface */ |
52 | private $container; |
53 | |
54 | private function __construct( ContainerInterface $container ) { |
55 | $this->container = $container; |
56 | } |
57 | |
58 | public static function getInstance(): Services { |
59 | return new self( MediaWikiServices::getInstance() ); |
60 | } |
61 | |
62 | /** @inheritDoc */ |
63 | public function get( string $id ) { |
64 | return $this->container->get( $id ); |
65 | } |
66 | |
67 | /** @inheritDoc */ |
68 | public function has( string $id ): bool { |
69 | return $this->container->has( $id ); |
70 | } |
71 | |
72 | public function getConfigHelper(): ConfigHelper { |
73 | return $this->get( 'Translate:ConfigHelper' ); |
74 | } |
75 | |
76 | /** @since 2022.06 */ |
77 | public function getCsvTranslationImporter(): CsvTranslationImporter { |
78 | return $this->get( 'Translate:CsvTranslationImporter' ); |
79 | } |
80 | |
81 | /** @since 2021.10 */ |
82 | public function getEntitySearch(): EntitySearch { |
83 | return $this->get( 'Translate:EntitySearch' ); |
84 | } |
85 | |
86 | public function getExternalMessageSourceStateComparator(): ExternalMessageSourceStateComparator { |
87 | return $this->get( 'Translate:ExternalMessageSourceStateComparator' ); |
88 | } |
89 | |
90 | public function getExternalMessageSourceStateImporter(): ExternalMessageSourceStateImporter { |
91 | return $this->get( 'Translate:ExternalMessageSourceStateImporter' ); |
92 | } |
93 | |
94 | public function getFileFormatFactory(): FileFormatFactory { |
95 | return $this->get( 'Translate:FileFormatFactory' ); |
96 | } |
97 | |
98 | public function getGroupSynchronizationCache(): GroupSynchronizationCache { |
99 | return $this->get( 'Translate:GroupSynchronizationCache' ); |
100 | } |
101 | |
102 | /** @since 2023.03 */ |
103 | public function getHookRunner(): HookRunner { |
104 | return $this->get( 'Translate:HookRunner' ); |
105 | } |
106 | |
107 | /** @since 2022.06 */ |
108 | public function getMessageBundleStore(): MessageBundleStore { |
109 | return $this->get( 'Translate:MessageBundleStore' ); |
110 | } |
111 | |
112 | /** @since 2020.10 */ |
113 | public function getMessageIndex(): MessageIndex { |
114 | return $this->get( 'Translate:MessageIndex' ); |
115 | } |
116 | |
117 | /** @since 2022.07 */ |
118 | public function getMessageGroupReviewStore(): MessageGroupReviewStore { |
119 | return $this->get( 'Translate:MessageGroupReviewStore' ); |
120 | } |
121 | |
122 | /** @since 2023.02 */ |
123 | public function getMessageGroupStatsTableFactory(): MessageGroupStatsTableFactory { |
124 | return $this->get( 'Translate:MessageGroupStatsTableFactory' ); |
125 | } |
126 | |
127 | /** @since 2024.04 */ |
128 | public function getMessageGroupSubscription(): MessageGroupSubscription { |
129 | return $this->get( 'Translate:MessageGroupSubscription' ); |
130 | } |
131 | |
132 | /** @since 2024.04 */ |
133 | public function getMessageGroupSubscriptionHookHandler(): MessageGroupSubscriptionHookHandler { |
134 | return $this->get( 'Translate:MessageGroupSubscriptionHookHandler' ); |
135 | } |
136 | |
137 | /** @since 2020.07 */ |
138 | public function getParsingPlaceholderFactory(): ParsingPlaceholderFactory { |
139 | return $this->get( 'Translate:ParsingPlaceholderFactory' ); |
140 | } |
141 | |
142 | /** @since 2020.12 */ |
143 | public function getPersistentCache(): PersistentCache { |
144 | return $this->get( 'Translate:PersistentCache' ); |
145 | } |
146 | |
147 | /** @since 2020.12 */ |
148 | public function getProgressStatsTableFactory(): ProgressStatsTableFactory { |
149 | return $this->get( 'Translate:ProgressStatsTableFactory' ); |
150 | } |
151 | |
152 | /** @since 2023.08 */ |
153 | public function getRevTagStore(): RevTagStore { |
154 | return $this->get( 'Translate:RevTagStore' ); |
155 | } |
156 | |
157 | /** @since 2023.05 */ |
158 | public function getTranslatableBundleExporter(): TranslatableBundleExporter { |
159 | return $this->get( 'Translate:TranslatableBundleExporter' ); |
160 | } |
161 | |
162 | /** @since 2023.05 */ |
163 | public function getTranslatableBundleImporter(): TranslatableBundleImporter { |
164 | return $this->get( 'Translate:TranslatableBundleImporter' ); |
165 | } |
166 | |
167 | /** @since 2022.03 */ |
168 | public function getTranslatableBundleFactory(): TranslatableBundleFactory { |
169 | return $this->get( 'Translate:TranslatableBundleFactory' ); |
170 | } |
171 | |
172 | /** @since 2022.02 */ |
173 | public function getTranslatableBundleMover(): TranslatableBundleMover { |
174 | return $this->get( 'Translate:TranslatableBundleMover' ); |
175 | } |
176 | |
177 | /** @since 2022.10 */ |
178 | public function getTranslatableBundleStatusStore(): TranslatableBundleStatusStore { |
179 | return $this->get( 'Translate:TranslatableBundleStatusStore' ); |
180 | } |
181 | |
182 | public function getTranslatablePageMarker(): TranslatablePageMarker { |
183 | return $this->get( 'Translate:TranslatablePageMarker' ); |
184 | } |
185 | |
186 | public function getTranslatablePageParser(): TranslatablePageParser { |
187 | return $this->get( 'Translate:TranslatablePageParser' ); |
188 | } |
189 | |
190 | /** @since 2022.03 */ |
191 | public function getTranslatablePageStore(): TranslatablePageStore { |
192 | return $this->get( 'Translate:TranslatablePageStore' ); |
193 | } |
194 | |
195 | /** @since 2024.04 */ |
196 | public function getMessageGroupMetadata(): MessageGroupMetadata { |
197 | return $this->get( 'Translate:MessageGroupMetadata' ); |
198 | } |
199 | |
200 | /** @since 2023.11 */ |
201 | public function getTranslateSandbox(): TranslateSandbox { |
202 | return $this->get( 'Translate:TranslateSandbox' ); |
203 | } |
204 | |
205 | /** @since 2020.11 */ |
206 | public function getTranslationStashReader(): TranslationStashReader { |
207 | return $this->get( 'Translate:TranslationStashReader' ); |
208 | } |
209 | |
210 | /** @since 2020.09 */ |
211 | public function getTranslationStatsDataProvider(): TranslationStatsDataProvider { |
212 | return $this->get( 'Translate:TranslationStatsDataProvider' ); |
213 | } |
214 | |
215 | /** @since 2021.05 */ |
216 | public function getTranslationUnitStoreFactory(): TranslationUnitStoreFactory { |
217 | return $this->get( 'Translate:TranslationUnitStoreFactory' ); |
218 | } |
219 | |
220 | public function getTranslatorActivity(): TranslatorActivity { |
221 | return $this->get( 'Translate:TranslatorActivity' ); |
222 | } |
223 | |
224 | /** @since 2021.01 */ |
225 | public function getTtmServerFactory(): TtmServerFactory { |
226 | return $this->get( 'Translate:TtmServerFactory' ); |
227 | } |
228 | } |