Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
EnConverter
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
20
0.00% covered (danger)
0.00%
0 / 1
 loadDefaultTables
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 findVariantLink
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
12
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\Parsoid\Language;
5
6use Wikimedia\LangConv\FstReplacementMachine;
7
8class EnConverter extends LanguageConverter {
9
10    public function loadDefaultTables() {
11        $this->setMachine( new FstReplacementMachine( 'en', [ 'en', 'en-x-piglatin' ] ) );
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 'en'
22        return parent::findVariantLink( $link, $nt, $ignoreOtherCond );
23    }
24}