The versatile default implementation of StringMangler interface. More...
Public Member Functions | |
| __construct (string $prefix='', array $patterns=[]) | |
| setConf (array $conf) | |
| @inheritDoc | |
| matches (string $key) | |
| @inheritDoc | |
| mangle (string $key) | |
| @inheritDoc | |
| mangleList (array $list) | |
| @inheritDoc | |
| mangleArray (array $array) | |
| @inheritDoc | |
| unmangle (string $key) | |
| @inheritDoc | |
| unmangleList (array $list) | |
| @inheritDoc | |
| unmangleArray (array $array) | |
| @inheritDoc | |
Static Public Member Functions | |
| static | getExtraSchema () |
| @inheritDoc | |
Protected Member Functions | |
| init (array $strings) | |
| Preprocesses the patterns. | |
Static Protected Member Functions | |
| static | getValidKeyChars () |
Protected Attributes | |
| string | $sPrefix = '' |
| array | $aExact = [] |
| array | $aPrefix = [] |
| array | $aRegex = [] |
The versatile default implementation of StringMangler interface.
It supports exact matches and patterns with any-wildcard (*). All matching strings are prefixed with the same prefix.
Definition at line 17 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::__construct | ( | string | $prefix = '', |
| array | $patterns = [] ) |
Definition at line 27 of file StringMatcher.php.
|
static |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageGroupConfiguration\MetaYamlSchemaExtender.
Definition at line 181 of file StringMatcher.php.
|
staticprotected |
Definition at line 55 of file StringMatcher.php.
|
protected |
Preprocesses the patterns.
They are split into exact keys, prefix matches and pattern matches to speed up matching process.
| string[] | $strings | Key patterns. |
Definition at line 40 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::mangle | ( | string | $key | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 99 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::mangleArray | ( | array | $array | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 129 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::mangleList | ( | array | $list | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 124 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::matches | ( | string | $key | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 78 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::setConf | ( | array | $conf | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 72 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::unmangle | ( | string | $key | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 139 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::unmangleArray | ( | array | $array | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 171 of file StringMatcher.php.
| MediaWiki\Extension\Translate\MessageProcessing\StringMatcher::unmangleList | ( | array | $list | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\MessageProcessing\StringMangler.
Definition at line 162 of file StringMatcher.php.
|
protected |
Definition at line 21 of file StringMatcher.php.
|
protected |
Definition at line 23 of file StringMatcher.php.
|
protected |
Definition at line 25 of file StringMatcher.php.
|
protected |
Definition at line 19 of file StringMatcher.php.