Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
28.57% |
4 / 14 |
|
28.57% |
2 / 7 |
CRAP | |
0.00% |
0 / 1 |
| WikibaseLexemeServices | |
28.57% |
4 / 14 |
|
28.57% |
2 / 7 |
85.43 | |
0.00% |
0 / 1 |
| getTermLanguages | |
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\Presentation\ChangeOp\Deserialization\EditFormChangeOpDeserializer; |
| 11 | use Wikibase\Lib\ContentLanguages; |
| 12 | use Wikibase\Lib\Store\ItemOrderProvider; |
| 13 | |
| 14 | /** |
| 15 | * @license GPL-2.0-or-later |
| 16 | */ |
| 17 | class WikibaseLexemeServices { |
| 18 | |
| 19 | public static function getTermLanguages( |
| 20 | ?ContainerInterface $services = null |
| 21 | ): ContentLanguages { |
| 22 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 23 | ->get( 'WikibaseLexemeTermLanguages' ); |
| 24 | } |
| 25 | |
| 26 | public static function getMobileView( |
| 27 | ?ContainerInterface $services = null |
| 28 | ): bool { |
| 29 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 30 | ->get( 'WikibaseLexemeMobileView' ); |
| 31 | } |
| 32 | |
| 33 | public static function getLemmaLookup( |
| 34 | ?ContainerInterface $services = null |
| 35 | ): LemmaLookup { |
| 36 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 37 | ->get( 'WikibaseLexemeLemmaLookup' ); |
| 38 | } |
| 39 | |
| 40 | public static function getLemmaTermValidator( |
| 41 | ?ContainerInterface $services = null |
| 42 | ): LemmaTermValidator { |
| 43 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 44 | ->get( 'WikibaseLexemeLemmaTermValidator' ); |
| 45 | } |
| 46 | |
| 47 | public static function getEditFormChangeOpDeserializer( |
| 48 | ?ContainerInterface $services = null |
| 49 | ): EditFormChangeOpDeserializer { |
| 50 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 51 | ->get( 'WikibaseLexemeEditFormChangeOpDeserializer' ); |
| 52 | } |
| 53 | |
| 54 | public static function getGrammaticalFeaturesOrderProvider( |
| 55 | ?ContainerInterface $services = null |
| 56 | ): ItemOrderProvider { |
| 57 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 58 | ->get( 'WikibaseLexemeGrammaticalFeaturesOrderProvider' ); |
| 59 | } |
| 60 | |
| 61 | public static function getMergeLexemesInteractor( |
| 62 | ?ContainerInterface $services = null |
| 63 | ): MergeLexemesInteractor { |
| 64 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 65 | ->get( 'WikibaseLexemeMergeLexemesInteractor' ); |
| 66 | } |
| 67 | |
| 68 | } |