MediaWiki master
MediaWiki\Language\ReplacementArray Class Reference

Wrapper around strtr() that holds replacements. More...

Public Member Functions

 __construct (array $data=[])
 Create an object with the specified replacement array The array should have the same form as the replacement array for strtr()
 
 __sleep ()
 
 getArray ()
 
 merge (ReplacementArray $other)
 
 mergeArray ( $data)
 
 removeArray ( $data)
 
 removePair ( $from)
 
 replace ( $subject)
 
 setArray (array $data)
 Set the whole replacement array at once.
 
 setPair ( $from, $to)
 Set an element of the replacement array.
 

Detailed Description

Wrapper around strtr() that holds replacements.

Definition at line 26 of file ReplacementArray.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Language\ReplacementArray::__construct ( array $data = [])

Create an object with the specified replacement array The array should have the same form as the replacement array for strtr()

Parameters
array$data

Definition at line 34 of file ReplacementArray.php.

Member Function Documentation

◆ __sleep()

MediaWiki\Language\ReplacementArray::__sleep ( )
Returns
array

Definition at line 41 of file ReplacementArray.php.

◆ getArray()

MediaWiki\Language\ReplacementArray::getArray ( )
Returns
array

Definition at line 56 of file ReplacementArray.php.

◆ merge()

MediaWiki\Language\ReplacementArray::merge ( ReplacementArray $other)
Parameters
ReplacementArray$other

Definition at line 79 of file ReplacementArray.php.

◆ mergeArray()

MediaWiki\Language\ReplacementArray::mergeArray ( $data)
Parameters
array$data

Definition at line 72 of file ReplacementArray.php.

◆ removeArray()

MediaWiki\Language\ReplacementArray::removeArray ( $data)
Parameters
array$data

Definition at line 93 of file ReplacementArray.php.

References MediaWiki\Language\ReplacementArray\removePair().

◆ removePair()

MediaWiki\Language\ReplacementArray::removePair ( $from)
Parameters
string$from

Definition at line 86 of file ReplacementArray.php.

Referenced by MediaWiki\Language\ReplacementArray\removeArray().

◆ replace()

MediaWiki\Language\ReplacementArray::replace ( $subject)
Parameters
string$subject
Returns
string

Definition at line 103 of file ReplacementArray.php.

◆ setArray()

MediaWiki\Language\ReplacementArray::setArray ( array $data)

Set the whole replacement array at once.

Parameters
array$data

Definition at line 49 of file ReplacementArray.php.

◆ setPair()

MediaWiki\Language\ReplacementArray::setPair ( $from,
$to )

Set an element of the replacement array.

Parameters
string$from
string$to

Definition at line 65 of file ReplacementArray.php.


The documentation for this class was generated from the following file: