Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 7
CRAP
0.00% covered (danger)
0.00%
0 / 1
WikispeechServices
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 7
210
0.00% covered (danger)
0.00%
0 / 1
 getConfiguredLexiconStorage
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 getLexiconHandler
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 getLexiconWikiStorage
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 getLexiconSpeechoidStorage
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 getLexiconWanCacheStorage
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 getSpeechoidConnector
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 getUtteranceGenerator
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace MediaWiki\Wikispeech;
4
5use MediaWiki\MediaWikiServices;
6use MediaWiki\Wikispeech\Lexicon\ConfiguredLexiconStorage;
7use MediaWiki\Wikispeech\Lexicon\LexiconHandler;
8use MediaWiki\Wikispeech\Lexicon\LexiconSpeechoidStorage;
9use MediaWiki\Wikispeech\Lexicon\LexiconWanCacheStorage;
10use MediaWiki\Wikispeech\Lexicon\LexiconWikiStorage;
11use MediaWiki\Wikispeech\Utterance\UtteranceGenerator;
12use Psr\Container\ContainerInterface;
13
14class WikispeechServices {
15
16    /**
17     * @param ContainerInterface|null $services Service container to
18     *  use. If null, global MediaWikiServices::getInstance() will be
19     *  used instead.
20     *
21     * @return ConfiguredLexiconStorage
22     */
23    public static function getConfiguredLexiconStorage(
24        ?ContainerInterface $services = null
25    ): ConfiguredLexiconStorage {
26        return ( $services ?: MediaWikiServices::getInstance() )
27            ->get( 'Wikispeech.ConfiguredLexiconStorage' );
28    }
29
30    /**
31     * @param ContainerInterface|null $services Service container to
32     *  use. If null, global MediaWikiServices::getInstance() will be
33     *  used instead.
34     *
35     * @return LexiconHandler
36     */
37    public static function getLexiconHandler(
38        ?ContainerInterface $services = null
39    ): LexiconHandler {
40        return ( $services ?: MediaWikiServices::getInstance() )
41            ->get( 'Wikispeech.LexiconHandler' );
42    }
43
44    /**
45     * @param ContainerInterface|null $services Service container to
46     *  use. If null, global MediaWikiServices::getInstance() will be
47     *  used instead.
48     *
49     * @return LexiconWikiStorage
50     */
51    public static function getLexiconWikiStorage(
52        ?ContainerInterface $services = null
53    ): LexiconWikiStorage {
54        return ( $services ?: MediaWikiServices::getInstance() )
55            ->get( 'Wikispeech.LexiconWikiStorage' );
56    }
57
58    /**
59     * @param ContainerInterface|null $services Service container to
60     *  use. If null, global MediaWikiServices::getInstance() will be
61     *  used instead.
62     *
63     * @return LexiconSpeechoidStorage
64     */
65    public static function getLexiconSpeechoidStorage(
66        ?ContainerInterface $services = null
67    ): LexiconSpeechoidStorage {
68        return ( $services ?: MediaWikiServices::getInstance() )
69            ->get( 'Wikispeech.LexiconSpeechoidStorage' );
70    }
71
72    /**
73     * @param ContainerInterface|null $services Service container to
74     *  use. If null, global MediaWikiServices::getInstance() will be
75     *  used instead.
76     *
77     * @return LexiconWanCacheStorage
78     */
79    public static function getLexiconWanCacheStorage(
80        ?ContainerInterface $services = null
81    ): LexiconWanCacheStorage {
82        return ( $services ?: MediaWikiServices::getInstance() )
83            ->get( 'Wikispeech.LexiconWanCacheStorage' );
84    }
85
86    /**
87     * @param ContainerInterface|null $services Service container to
88     *  use. If null, global MediaWikiServices::getInstance() will be
89     *  used instead.
90     *
91     * @return SpeechoidConnector
92     */
93    public static function getSpeechoidConnector(
94        ?ContainerInterface $services = null
95    ): SpeechoidConnector {
96        return ( $services ?: MediaWikiServices::getInstance() )
97            ->get( 'Wikispeech.SpeechoidConnector' );
98    }
99
100    /**
101     * @param ContainerInterface|null $services Service container to
102     *  use. If null, global MediaWikiServices::getInstance() will be
103     *  used instead.
104     *
105     * @return UtteranceGenerator
106     */
107    public static function getUtteranceGenerator(
108        ?ContainerInterface $services = null
109    ): UtteranceGenerator {
110        return ( $services ?: MediaWikiServices::getInstance() )
111            ->get( 'Wikispeech.UtteranceGenerator' );
112    }
113
114}