Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ArticleCountriesDefinition | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| getCountries | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1 ); |
| 4 | |
| 5 | namespace ContentTranslation; |
| 6 | |
| 7 | use MediaWiki\Extension\WikimediaMessages\ArticleCountryFiltersRegistry; |
| 8 | use MediaWiki\ResourceLoader\Context; |
| 9 | |
| 10 | class ArticleCountriesDefinition { |
| 11 | |
| 12 | /** |
| 13 | * Get the list of supported article countries, grouped by regions, |
| 14 | * with their label in the current language. |
| 15 | * |
| 16 | * Sorted by localized label. |
| 17 | * |
| 18 | * @param Context $context |
| 19 | * @return array |
| 20 | * [ |
| 21 | * [ |
| 22 | * 'id' => string, |
| 23 | * 'label' => string, |
| 24 | * 'countries' => [ |
| 25 | * [ |
| 26 | * 'id' => string, |
| 27 | * 'label' => string, |
| 28 | * ] |
| 29 | * ], |
| 30 | * ] |
| 31 | */ |
| 32 | public static function getCountries( Context $context ) { |
| 33 | return ArticleCountryFiltersRegistry::getLocalizedRegionsAndCountries( $context->getLanguage() ); |
| 34 | } |
| 35 | } |