Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1425637
MessageFormatterFactory.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1016 B
Referenced Files
None
Subscribers
None
MessageFormatterFactory.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment