MediaWiki  1.34.4
MessageFormatterFactory.php
Go to the documentation of this file.
1 <?php
2 
3 namespace MediaWiki\Message;
4 
7 
11 class MessageFormatterFactory implements IMessageFormatterFactory {
12  private $textFormatters = [];
13 
20  public function __construct() {
21  }
22 
23  public function getTextFormatter( $langCode ): ITextFormatter {
24  if ( !isset( $this->textFormatters[$langCode] ) ) {
25  $this->textFormatters[$langCode] = new TextFormatter( $langCode );
26  }
27  return $this->textFormatters[$langCode];
28  }
29 }
Wikimedia\Message\ITextFormatter
Definition: ITextFormatter.php:18
Message\MessageFormatterFactory
The MediaWiki-specific implementation of IMessageFormatterFactory.
Definition: MessageFormatterFactory.php:11
Message\TextFormatter
The MediaWiki-specific implementation of ITextFormatter.
Definition: TextFormatter.php:15
Message\MessageFormatterFactory\getTextFormatter
getTextFormatter( $langCode)
Get a text message formatter for a given language.
Definition: MessageFormatterFactory.php:23
MediaWiki\Message
Definition: MessageFormatterFactory.php:3
Wikimedia\Message\IMessageFormatterFactory
A simple factory providing a message formatter for a given language code.
Definition: IMessageFormatterFactory.php:10
Message\MessageFormatterFactory\__construct
__construct()
Required parameters may be added to this function without deprecation.
Definition: MessageFormatterFactory.php:20
Message\MessageFormatterFactory\$textFormatters
$textFormatters
Definition: MessageFormatterFactory.php:12