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