Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| CrhConverter | |
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\FstReplacementMachine; |
| 7 | |
| 8 | class CrhConverter extends LanguageConverter { |
| 9 | |
| 10 | public function loadDefaultTables() { |
| 11 | $this->setMachine( new FstReplacementMachine( 'crh', [ 'crh-latn', 'crh-cyrl' ] ) ); |
| 12 | } |
| 13 | |
| 14 | // phpcs:ignore MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic |
| 15 | public function findVariantLink( $link, $nt, $ignoreOtherCond ) { |
| 16 | $ns = $nt->getNamespace(); |
| 17 | // do not try to find variants for usernames |
| 18 | if ( $ns->isUser() || $ns->isUserTalk ) { |
| 19 | return [ 'nt' => $nt, 'link' => $link ]; |
| 20 | } |
| 21 | // FIXME check whether selected language is 'crh' |
| 22 | return parent::findVariantLink( $link, $nt, $ignoreOtherCond ); |
| 23 | } |
| 24 | |
| 25 | } |