MediaWiki  1.34.0
Message\TextFormatter Class Reference

The MediaWiki-specific implementation of ITextFormatter. More...

Inheritance diagram for Message\TextFormatter:
Collaboration diagram for Message\TextFormatter:

Public Member Functions

 __construct ( $langCode)
 Construct a TextFormatter. More...
 
 format (MessageValue $mv)
 
 getLangCode ()
 Get the internal language code in which format() is. More...
 
- Public Member Functions inherited from Wikimedia\Message\ITextFormatter
 format (MessageValue $message)
 Convert a MessageValue to text. More...
 

Protected Member Functions

 createMessage ( $key)
 Allow the Message class to be mocked in tests by constructing objects in a protected method. More...
 

Private Member Functions

 convertParam (MessageParam $param)
 

Private Attributes

string $langCode
 

Detailed Description

The MediaWiki-specific implementation of ITextFormatter.

Definition at line 15 of file TextFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

Message\TextFormatter::__construct (   $langCode)

Construct a TextFormatter.

The type signature may change without notice as dependencies are added to the constructor. External callers should use MediaWikiServices::getMessageFormatterFactory()

Definition at line 28 of file TextFormatter.php.

References Message\TextFormatter\$langCode.

Member Function Documentation

◆ convertParam()

Message\TextFormatter::convertParam ( MessageParam  $param)
private

◆ createMessage()

Message\TextFormatter::createMessage (   $key)
protected

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

Definition at line 40 of file TextFormatter.php.

Referenced by Message\TextFormatter\convertParam(), and Message\TextFormatter\format().

◆ format()

Message\TextFormatter::format ( MessageValue  $mv)

◆ getLangCode()

Message\TextFormatter::getLangCode ( )

Get the internal language code in which format() is.

Returns
string

Implements Wikimedia\Message\ITextFormatter.

Definition at line 44 of file TextFormatter.php.

References Message\TextFormatter\$langCode.

Member Data Documentation

◆ $langCode

string Message\TextFormatter::$langCode
private

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