Merge "Add .pipeline/ with dev image variant"
[lhc/web/wiklou.git] / includes / Message / MessageFormatterFactory.php
1 <?php
2
3 namespace MediaWiki\Message;
4
5 use Wikimedia\Message\IMessageFormatterFactory;
6 use Wikimedia\Message\ITextFormatter;
7
8 /**
9 * The MediaWiki-specific implementation of IMessageFormatterFactory
10 */
11 class MessageFormatterFactory implements IMessageFormatterFactory {
12 private $textFormatters = [];
13
14 /**
15 * Required parameters may be added to this function without deprecation.
16 * External callers should use MediaWikiServices::getMessageFormatterFactory().
17 *
18 * @internal
19 */
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 }