MediaWiki  master
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 (string $langCode, Converter $converter, string $format=Message::FORMAT_TEXT)
 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...
 

Private Attributes

Converter $converter
 
string $format
 
string $langCode
 

Detailed Description

The MediaWiki-specific implementation of ITextFormatter.

Definition at line 12 of file TextFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

Message\TextFormatter::__construct ( string  $langCode,
Converter  $converter,
string  $format = Message::FORMAT_TEXT 
)

Construct a TextFormatter.

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

Access: internal
Parameters
string$langCode
Converter$converter
string$format

Definition at line 34 of file TextFormatter.php.

References Message\TextFormatter\$converter, Message\TextFormatter\$format, Message\TextFormatter\$langCode, and Message\TextFormatter\format().

Member Function Documentation

◆ format()

Message\TextFormatter::format ( MessageValue  $mv)

Definition at line 48 of file TextFormatter.php.

Referenced by Message\TextFormatter\__construct().

◆ 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

◆ $converter

Converter Message\TextFormatter::$converter
private

Definition at line 14 of file TextFormatter.php.

Referenced by Message\TextFormatter\__construct().

◆ $format

string Message\TextFormatter::$format
private

Definition at line 20 of file TextFormatter.php.

Referenced by Message\TextFormatter\__construct().

◆ $langCode

string Message\TextFormatter::$langCode
private

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