Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace Wikimedia\Message;
4
5/**
6 * Converts MessageSpecifier objects to localized plain text in a certain language.
7 *
8 * The caller cannot modify the details of message translation, such as which
9 * of multiple sources the message is taken from. Any such flags may be injected
10 * into the factory constructor.
11 *
12 * Implementations of TextFormatter are not required to perfectly format
13 * any message in any language. Implementations should make a best effort to
14 * produce human-readable text.
15 *
16 * @package MediaWiki\MessageFormatter
17 */
18interface ITextFormatter {
19    /**
20     * Get the internal language code in which format() is
21     * @return string
22     */
23    public function getLangCode(): string;
24
25    /**
26     * Convert a MessageSpecifier to text.
27     *
28     * The result is not safe for use as raw HTML.
29     *
30     * @param MessageSpecifier $message
31     * @return string
32     * @return-taint tainted
33     */
34    public function format( MessageSpecifier $message ): string;
35}