Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 22 |
|
0.00% |
0 / 11 |
CRAP | |
0.00% |
0 / 1 |
| WikispeechServices | |
0.00% |
0 / 22 |
|
0.00% |
0 / 11 |
506 | |
0.00% |
0 / 1 |
| getConfiguredLexiconStorage | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getLexiconHandler | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getLexiconWikiStorage | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getLexiconSpeechoidStorage | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getLexiconWanCacheStorage | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getSpeechoidConnector | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getSegmentPageFactory | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getSegmentMessagesFactory | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getUtteranceGenerator | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getUtteranceStore | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| getVoiceHandler | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Wikispeech; |
| 4 | |
| 5 | use MediaWiki\MediaWikiServices; |
| 6 | use MediaWiki\Wikispeech\Lexicon\ConfiguredLexiconStorage; |
| 7 | use MediaWiki\Wikispeech\Lexicon\LexiconHandler; |
| 8 | use MediaWiki\Wikispeech\Lexicon\LexiconSpeechoidStorage; |
| 9 | use MediaWiki\Wikispeech\Lexicon\LexiconWanCacheStorage; |
| 10 | use MediaWiki\Wikispeech\Lexicon\LexiconWikiStorage; |
| 11 | use MediaWiki\Wikispeech\Segment\SegmentMessagesFactory; |
| 12 | use MediaWiki\Wikispeech\Segment\SegmentPageFactory; |
| 13 | use MediaWiki\Wikispeech\Utterance\UtteranceGenerator; |
| 14 | use MediaWiki\Wikispeech\Utterance\UtteranceStore; |
| 15 | use Psr\Container\ContainerInterface; |
| 16 | |
| 17 | class WikispeechServices { |
| 18 | |
| 19 | /** |
| 20 | * @param ContainerInterface|null $services Service container to |
| 21 | * use. If null, global MediaWikiServices::getInstance() will be |
| 22 | * used instead. |
| 23 | * |
| 24 | * @return ConfiguredLexiconStorage |
| 25 | */ |
| 26 | public static function getConfiguredLexiconStorage( |
| 27 | ?ContainerInterface $services = null |
| 28 | ): ConfiguredLexiconStorage { |
| 29 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 30 | ->get( 'Wikispeech.ConfiguredLexiconStorage' ); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @param ContainerInterface|null $services Service container to |
| 35 | * use. If null, global MediaWikiServices::getInstance() will be |
| 36 | * used instead. |
| 37 | * |
| 38 | * @return LexiconHandler |
| 39 | */ |
| 40 | public static function getLexiconHandler( |
| 41 | ?ContainerInterface $services = null |
| 42 | ): LexiconHandler { |
| 43 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 44 | ->get( 'Wikispeech.LexiconHandler' ); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * @param ContainerInterface|null $services Service container to |
| 49 | * use. If null, global MediaWikiServices::getInstance() will be |
| 50 | * used instead. |
| 51 | * |
| 52 | * @return LexiconWikiStorage |
| 53 | */ |
| 54 | public static function getLexiconWikiStorage( |
| 55 | ?ContainerInterface $services = null |
| 56 | ): LexiconWikiStorage { |
| 57 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 58 | ->get( 'Wikispeech.LexiconWikiStorage' ); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * @param ContainerInterface|null $services Service container to |
| 63 | * use. If null, global MediaWikiServices::getInstance() will be |
| 64 | * used instead. |
| 65 | * |
| 66 | * @return LexiconSpeechoidStorage |
| 67 | */ |
| 68 | public static function getLexiconSpeechoidStorage( |
| 69 | ?ContainerInterface $services = null |
| 70 | ): LexiconSpeechoidStorage { |
| 71 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 72 | ->get( 'Wikispeech.LexiconSpeechoidStorage' ); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * @param ContainerInterface|null $services Service container to |
| 77 | * use. If null, global MediaWikiServices::getInstance() will be |
| 78 | * used instead. |
| 79 | * |
| 80 | * @return LexiconWanCacheStorage |
| 81 | */ |
| 82 | public static function getLexiconWanCacheStorage( |
| 83 | ?ContainerInterface $services = null |
| 84 | ): LexiconWanCacheStorage { |
| 85 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 86 | ->get( 'Wikispeech.LexiconWanCacheStorage' ); |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * @param ContainerInterface|null $services Service container to |
| 91 | * use. If null, global MediaWikiServices::getInstance() will be |
| 92 | * used instead. |
| 93 | * |
| 94 | * @return SpeechoidConnector |
| 95 | */ |
| 96 | public static function getSpeechoidConnector( |
| 97 | ?ContainerInterface $services = null |
| 98 | ): SpeechoidConnector { |
| 99 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 100 | ->get( 'Wikispeech.SpeechoidConnector' ); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * @param ContainerInterface|null $services Service container to |
| 105 | * use. If null, global MediaWikiServices::getInstance() will be |
| 106 | * used instead. |
| 107 | * |
| 108 | * @return SegmentPageFactory |
| 109 | */ |
| 110 | public static function getSegmentPageFactory( |
| 111 | ?ContainerInterface $services = null |
| 112 | ): SegmentPageFactory { |
| 113 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 114 | ->get( 'Wikispeech.SegmentPageFactory' ); |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * @param ContainerInterface|null $services Service container to |
| 119 | * use. If null, global MediaWikiServices::getInstance() will be |
| 120 | * used instead. |
| 121 | * |
| 122 | * @return SegmentMessagesFactory |
| 123 | */ |
| 124 | public static function getSegmentMessagesFactory( |
| 125 | ?ContainerInterface $services = null |
| 126 | ): SegmentMessagesFactory { |
| 127 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 128 | ->get( 'Wikispeech.SegmentMessagesFactory' ); |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * @param ContainerInterface|null $services Service container to |
| 133 | * use. If null, global MediaWikiServices::getInstance() will be |
| 134 | * used instead. |
| 135 | * |
| 136 | * @return UtteranceGenerator |
| 137 | */ |
| 138 | public static function getUtteranceGenerator( |
| 139 | ?ContainerInterface $services = null |
| 140 | ): UtteranceGenerator { |
| 141 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 142 | ->get( 'Wikispeech.UtteranceGenerator' ); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * @param ContainerInterface|null $services Service container to |
| 147 | * use. If null, global MediaWikiServices::getInstance() will be |
| 148 | * used instead. |
| 149 | * |
| 150 | * @return UtteranceStore |
| 151 | */ |
| 152 | public static function getUtteranceStore( |
| 153 | ?ContainerInterface $services = null |
| 154 | ): UtteranceStore { |
| 155 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 156 | ->get( 'Wikispeech.UtteranceStore' ); |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * @param ContainerInterface|null $services Service container to |
| 161 | * use. If null, global MediaWikiServices::getInstance() will be |
| 162 | * used instead. |
| 163 | * |
| 164 | * @return VoiceHandler |
| 165 | */ |
| 166 | public static function getVoiceHandler( |
| 167 | ?ContainerInterface $services = null |
| 168 | ): VoiceHandler { |
| 169 | return ( $services ?: MediaWikiServices::getInstance() ) |
| 170 | ->get( 'Wikispeech.VoiceHandler' ); |
| 171 | } |
| 172 | |
| 173 | } |