Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
LexemeLanguageCodePropertyIdConfig | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
getScript | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Wikibase\Lexeme\MediaWiki\Config; |
4 | |
5 | // phpcs:disable MediaWiki.Classes.FullQualifiedClassName -- T308814 |
6 | use MediaWiki\ResourceLoader as RL; |
7 | |
8 | /** |
9 | * @license GPL-2.0-or-later |
10 | */ |
11 | class LexemeLanguageCodePropertyIdConfig extends RL\Module { |
12 | |
13 | /** |
14 | * Propagate the ISO 639-2 code property ID from PHP to JavaScript. |
15 | * |
16 | * @see RL\Module::getScript |
17 | * @param RL\Context $context |
18 | * @return string |
19 | */ |
20 | public function getScript( RL\Context $context ) { |
21 | return 'mw.config.set(' . $context->encodeJson( [ |
22 | 'LexemeLanguageCodePropertyId' => $this->getConfig()->get( 'LexemeLanguageCodePropertyId' ), |
23 | ] ) . ');'; |
24 | } |
25 | |
26 | } |