X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=inline;f=languages%2FConverterRule.php;h=8be2d6aed0b697a3d86ac20ea301d751db0962e4;hb=d4e88508689aebfc9653f3a260428458e6fe15ad;hp=8dfe00f88c15aed874cf8bd73f1731176b737504;hpb=b95ca29602793f39191c06cd6941e3f32ab1bbb8;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/ConverterRule.php b/languages/ConverterRule.php index 8dfe00f88c..8be2d6aed0 100644 --- a/languages/ConverterRule.php +++ b/languages/ConverterRule.php @@ -20,7 +20,7 @@ */ /** - * Parser for rules of language conversion , parse rules in -{ }- tag. + * Parser for rules of language conversion, parse rules in -{ }- tag. * @ingroup Language * @author fdcn , PhiLiP */ @@ -29,13 +29,13 @@ class ConverterRule { public $mConverter; // LanguageConverter object public $mRuleDisplay = ''; public $mRuleTitle = false; - public $mRules = '';// string : the text of the rules + public $mRules = ''; // string : the text of the rules public $mRulesAction = 'none'; public $mFlags = []; public $mVariantFlags = []; public $mConvTable = []; - public $mBidtable = [];// array of the translation in each variant - public $mUnidtable = [];// array of the translation in each variant + public $mBidtable = []; // array of the translation in each variant + public $mUnidtable = []; // array of the translation in each variant /** * @param string $text The text between -{ and }- @@ -330,7 +330,7 @@ class ConverterRule { /** * Parse rules and flags. - * @param string $variant Variant language code + * @param string|null $variant Variant language code */ public function parse( $variant = null ) { if ( !$variant ) { @@ -399,11 +399,7 @@ class ConverterRule { case 'N': // process N flag: output current variant name $ruleVar = trim( $rules ); - if ( isset( $this->mConverter->mVariantNames[$ruleVar] ) ) { - $this->mRuleDisplay = $this->mConverter->mVariantNames[$ruleVar]; - } else { - $this->mRuleDisplay = ''; - } + $this->mRuleDisplay = $this->mConverter->mVariantNames[$ruleVar] ?? ''; break; case 'D': // process D flag: output rules description