Page MenuHomeWickedGov Phorge

MessageFormatterFactory.php
No OneTemporary

Size
1016 B
Referenced Files
None
Subscribers
None

MessageFormatterFactory.php

<?php
namespace MediaWiki\Message;
use Wikimedia\Message\IMessageFormatterFactory;
use Wikimedia\Message\ITextFormatter;
/**
* The MediaWiki-specific implementation of IMessageFormatterFactory
*/
class MessageFormatterFactory implements IMessageFormatterFactory {
/** @var string */
private $format;
/** @var array */
private $textFormatters = [];
/**
* Required parameters may be added to this function without deprecation.
* External callers should use MediaWikiServices::getMessageFormatterFactory().
*
* @param string $format which if the Message::FORMAT_* to use in the formatters.
* @internal
*/
public function __construct( string $format = Message::FORMAT_TEXT ) {
$this->format = $format;
}
/**
* @inheritDoc
*/
public function getTextFormatter( $langCode ): ITextFormatter {
if ( !isset( $this->textFormatters[$langCode] ) ) {
$this->textFormatters[$langCode] = new TextFormatter(
$langCode, $this->format );
}
return $this->textFormatters[$langCode];
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 11:45 (16 h, 59 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
83/ec/9e9bd4472bf1f7470b4dbb75a10e
Default Alt Text
MessageFormatterFactory.php (1016 B)

Event Timeline