Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
ZhConverter | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
20 | |
0.00% |
0 / 1 |
loadDefaultTables | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
findVariantLink | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace Wikimedia\Parsoid\Language; |
5 | |
6 | use Wikimedia\LangConv\ZhReplacementMachine; |
7 | |
8 | /* @note: Use of this class is currently disabled in production, see T346657 */ |
9 | class ZhConverter extends LanguageConverter { |
10 | |
11 | public function loadDefaultTables() { |
12 | $this->setMachine( new ZhReplacementMachine() ); |
13 | } |
14 | |
15 | // phpcs:ignore MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic |
16 | public function findVariantLink( $link, $nt, $ignoreOtherCond ) { |
17 | $ns = $nt->getNamespace(); |
18 | // do not try to find variants for usernames |
19 | if ( $ns->isUser() || $ns->isUserTalk ) { |
20 | return [ 'nt' => $nt, 'link' => $link ]; |
21 | } |
22 | // FIXME check whether selected language is 'zh' |
23 | return parent::findVariantLink( $link, $nt, $ignoreOtherCond ); |
24 | } |
25 | } |