|
MediaWiki master
|
The MediaWiki-specific implementation of ITextFormatter. More...
Inherits Wikimedia\Message\ITextFormatter.

Public Member Functions | |
| __construct (string $langCode, string $format=Message::FORMAT_TEXT) | |
| format (MessageSpecifier $mv) | |
| Convert a MessageSpecifier to text. | |
| getLangCode () | |
| Get the internal language code in which format() is. | |
Protected Member Functions | |
| createMessage (MessageSpecifier $spec) | |
| Allow the Message class to be mocked in tests by constructing objects in a protected method. | |
The MediaWiki-specific implementation of ITextFormatter.
To obtain an instance, use \MediaWiki\MediaWikiServices::getMessageFormatterFactory() and call MessageFormatterFactory::getTextFormatter.
Definition at line 16 of file TextFormatter.php.
| MediaWiki\Message\TextFormatter::__construct | ( | string | $langCode, |
| string | $format = Message::FORMAT_TEXT ) |
| string | $langCode | |
| string | $format |
Definition at line 25 of file TextFormatter.php.
References MediaWiki\Message\TextFormatter\format().
|
protected |
Allow the Message class to be mocked in tests by constructing objects in a protected method.
| MessageSpecifier | $spec |
Definition at line 45 of file TextFormatter.php.
| MediaWiki\Message\TextFormatter::format | ( | MessageSpecifier | $message | ) |
Convert a MessageSpecifier to text.
The result is not safe for use as raw HTML.
| MessageSpecifier | $message |
Implements Wikimedia\Message\ITextFormatter.
Definition at line 49 of file TextFormatter.php.
Referenced by MediaWiki\Message\TextFormatter\__construct().
| MediaWiki\Message\TextFormatter::getLangCode | ( | ) |
Get the internal language code in which format() is.
Implements Wikimedia\Message\ITextFormatter.
Definition at line 33 of file TextFormatter.php.