Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
37.50% |
6 / 16 |
|
37.50% |
3 / 8 |
CRAP | |
0.00% |
0 / 1 |
WikibaseLexemeServices | |
37.50% |
6 / 16 |
|
37.50% |
3 / 8 |
78.50 | |
0.00% |
0 / 1 |
getTermLanguages | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
getLanguageNameLookupFactory | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
getMobileView | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
getLemmaLookup | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
getLemmaTermValidator | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
getEditFormChangeOpDeserializer | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
getGrammaticalFeaturesOrderProvider | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
getMergeLexemesInteractor | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Wikibase\Lexeme; |
4 | |
5 | use MediaWiki\MediaWikiServices; |
6 | use Psr\Container\ContainerInterface; |
7 | use Wikibase\Lexeme\DataAccess\ChangeOp\Validation\LemmaTermValidator; |
8 | use Wikibase\Lexeme\DataAccess\Store\LemmaLookup; |
9 | use Wikibase\Lexeme\Interactors\MergeLexemes\MergeLexemesInteractor; |
10 | use Wikibase\Lexeme\MediaWiki\Content\LexemeLanguageNameLookupFactory; |
11 | use Wikibase\Lexeme\Presentation\ChangeOp\Deserialization\EditFormChangeOpDeserializer; |
12 | use Wikibase\Lib\ContentLanguages; |
13 | use Wikibase\Lib\Store\ItemOrderProvider; |
14 | |
15 | /** |
16 | * @license GPL-2.0-or-later |
17 | */ |
18 | class WikibaseLexemeServices { |
19 | |
20 | public static function getTermLanguages( |
21 | ?ContainerInterface $services = null |
22 | ): ContentLanguages { |
23 | return ( $services ?: MediaWikiServices::getInstance() ) |
24 | ->get( 'WikibaseLexemeTermLanguages' ); |
25 | } |
26 | |
27 | public static function getLanguageNameLookupFactory( |
28 | ?ContainerInterface $services = null |
29 | ): LexemeLanguageNameLookupFactory { |
30 | return ( $services ?: MediaWikiServices::getInstance() ) |
31 | ->get( 'WikibaseLexemeLanguageNameLookupFactory' ); |
32 | } |
33 | |
34 | public static function getMobileView( |
35 | ?ContainerInterface $services = null |
36 | ): bool { |
37 | return ( $services ?: MediaWikiServices::getInstance() ) |
38 | ->get( 'WikibaseLexemeMobileView' ); |
39 | } |
40 | |
41 | public static function getLemmaLookup( |
42 | ?ContainerInterface $services = null |
43 | ): LemmaLookup { |
44 | return ( $services ?: MediaWikiServices::getInstance() ) |
45 | ->get( 'WikibaseLexemeLemmaLookup' ); |
46 | } |
47 | |
48 | public static function getLemmaTermValidator( |
49 | ?ContainerInterface $services = null |
50 | ): LemmaTermValidator { |
51 | return ( $services ?: MediaWikiServices::getInstance() ) |
52 | ->get( 'WikibaseLexemeLemmaTermValidator' ); |
53 | } |
54 | |
55 | public static function getEditFormChangeOpDeserializer( |
56 | ?ContainerInterface $services = null |
57 | ): EditFormChangeOpDeserializer { |
58 | return ( $services ?: MediaWikiServices::getInstance() ) |
59 | ->get( 'WikibaseLexemeEditFormChangeOpDeserializer' ); |
60 | } |
61 | |
62 | public static function getGrammaticalFeaturesOrderProvider( |
63 | ?ContainerInterface $services = null |
64 | ): ItemOrderProvider { |
65 | return ( $services ?: MediaWikiServices::getInstance() ) |
66 | ->get( 'WikibaseLexemeGrammaticalFeaturesOrderProvider' ); |
67 | } |
68 | |
69 | public static function getMergeLexemesInteractor( |
70 | ?ContainerInterface $services = null |
71 | ): MergeLexemesInteractor { |
72 | return ( $services ?: MediaWikiServices::getInstance() ) |
73 | ->get( 'WikibaseLexemeMergeLexemesInteractor' ); |
74 | } |
75 | |
76 | } |