Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1431011
StringMangler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
StringMangler.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\MessageProcessing
;
/**
* Interface that key-mangling classes must implement. Mangling is done to:
* - converting characters which would be invalid in titles to something valid
* - prefixing a set of messages to avoid conflicts when sharing a namespace
* with multiple message groups.
*
* The operations have to be reversible so that
* x equals unmangle( mangle( x ) ).
*
* @author Niklas Laxström
* @license GPL-2.0-or-later
*/
interface
StringMangler
{
/** General way to pass configuration to the mangler. */
public
function
setConf
(
array
$configuration
):
void
;
/**
* Match strings against a pattern.
*
* If string matches, mangle() prefixes the key.
*/
public
function
matches
(
string
$key
):
bool
;
/** Mangle a string. */
public
function
mangle
(
string
$key
):
string
;
/**
* Mangle a list of strings.
*
* @param string[] $list
* @return string[]
*/
public
function
mangleList
(
array
$list
):
array
;
/**
* Mangle the keys of an array.
*
* @param array<string,mixed> $array
* @return array<string,mixed>
*/
public
function
mangleArray
(
array
$array
):
array
;
/** Reverse mangling of a string. */
public
function
unmangle
(
string
$key
):
string
;
/**
* Reverse mangling a list of strings.
*
* @param string[] $list
* @return string[]
*/
public
function
unmangleList
(
array
$list
):
array
;
/**
* Reverse mangling of the keys of an array.
*
* @param array<string,mixed> $array
* @return array<string,mixed>
*/
public
function
unmangleArray
(
array
$array
):
array
;
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 19:55 (3 h, 19 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
76/57/301f6f640ac1782fa8badd5c3cb6
Default Alt Text
StringMangler.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment