Motivation
A couple of variables has left unchanged (public) after T243461:
public $mFlags; // Used in ConverterRule public $mDescCodeSep = ':'; // Used in ConverterRule, descendants public $mDescVarSep = ';'; // Used in ConverterRule, descendants public $mVariantNames; // Used in ConverterRule public $mVariants; // Used in ConverterRule
At the moment ConverterRule uses them.
$validFlags = $this->mConverter->mFlags;
In order to make them non-public, ConverterRule should be refactored to get the required data, not object.
Expected result
- public $mConverter; should be removed from ConverterRule.
- All required data should be injected through constructor like below:
public function __construct( $text, $flags, $convTable, ... ) { $this->mText = $text; $this->flags = $flags; ... }
- Visibility for all variables should be decreased to private as there's no reason to use them outside ConverterRule itself.
public $mRuleDisplay = '' ...etc.
->
private $mRuleDisplay = '' ...etc.
- The class ConverterRule should be marked as @internal as this is internal Implementation and no reason to use it outside the LanguageConverter.
- LanguageConverter should be changed accordingly. Public variables should be changed to private.
public $mFlags; ...etc.
->
private $mFlags; ...etc.
- Respective changes should be added to RELEASE-NOTES-1.35