MediaWiki REL1_35
MediaWiki\Message\Converter Class Reference

Converter between Message and MessageValue. More...

Public Member Functions

 convertMessage (Message $m)
 Convert a Message to a MessageValue.
 
 convertMessageValue (MessageValue $mv)
 Convert a MessageValue to a Message.
 
 createMessage ( $key)
 Allow the Message class to be mocked in tests by constructing objects in a protected method.
 

Private Member Functions

 convertMessageParam (MessageParam $param)
 Convert a MessageParam to a Message parameter.
 
 convertParam ( $param)
 Convert a Message parameter to a MessageParam.
 

Static Private Member Functions

static getTypes ()
 Return the ParamType constants.
 

Static Private Attributes

static string[] null $constants = null
 ParamType constants.
 

Detailed Description

Converter between Message and MessageValue.

Since
1.35

Definition at line 18 of file Converter.php.

Member Function Documentation

◆ convertMessage()

MediaWiki\Message\Converter::convertMessage ( Message  $m)

Convert a Message to a MessageValue.

Parameters
Message$m
Returns
MessageValue

Definition at line 53 of file Converter.php.

References MediaWiki\Message\Converter\convertParam(), Message\getKey(), and Message\getParams().

Referenced by MediaWiki\Message\Converter\convertParam().

◆ convertMessageParam()

MediaWiki\Message\Converter::convertMessageParam ( MessageParam  $param)
private

◆ convertMessageValue()

MediaWiki\Message\Converter::convertMessageValue ( MessageValue  $mv)

◆ convertParam()

MediaWiki\Message\Converter::convertParam (   $param)
private

Convert a Message parameter to a MessageParam.

Parameters
array | string | int$param
Returns
MessageParam

Definition at line 66 of file Converter.php.

References $type, MediaWiki\Message\Converter\convertMessage(), and MediaWiki\Message\Converter\convertParam().

Referenced by MediaWiki\Message\Converter\convertMessage(), and MediaWiki\Message\Converter\convertParam().

◆ createMessage()

MediaWiki\Message\Converter::createMessage (   $key)

Allow the Message class to be mocked in tests by constructing objects in a protected method.

Definition at line 44 of file Converter.php.

Referenced by MediaWiki\Message\Converter\convertMessageValue().

◆ getTypes()

static MediaWiki\Message\Converter::getTypes ( )
staticprivate

Return the ParamType constants.

Returns
string[]

Definition at line 27 of file Converter.php.

References MediaWiki\Message\Converter\$constants.

Member Data Documentation

◆ $constants

string [] null MediaWiki\Message\Converter::$constants = null
staticprivate

ParamType constants.

Definition at line 21 of file Converter.php.

Referenced by MediaWiki\Message\Converter\getTypes().


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