Provide command to adjust phpunit.xml for code coverage
[lhc/web/wiklou.git] / includes / libs / Message / TextParam.php
1 <?php
2
3 namespace Wikimedia\Message;
4
5 class TextParam extends MessageParam {
6 /**
7 * Construct a text parameter
8 *
9 * @param string $type May be one of:
10 * - ParamType::TEXT: A simple text parameter
11 * - ParamType::NUM: A number, to be formatted using local digits and
12 * separators
13 * - ParamType::DURATION_LONG: A number of seconds, to be formatted as natural
14 * language text.
15 * - ParamType::DURATION_SHORT: A number of seconds, to be formatted in an
16 * abbreviated way.
17 * - ParamType::EXPIRY: An expiry time for a block. The input is either
18 * a timestamp in one of the formats accepted by the Wikimedia\Timestamp
19 * library, or "infinity" for an infinite block.
20 * - ParamType::SIZE: A number of bytes.
21 * - ParamType::BITRATE: A number of bits per second.
22 * - ParamType::RAW: A text parameter which is substituted after
23 * preprocessing, and so is not available to the preprocessor and cannot
24 * be modified by it.
25 * - ParamType::PLAINTEXT: Reserved for future use.
26 *
27 * @param string|int|float $value
28 */
29 public function __construct( $type, $value ) {
30 $this->type = $type;
31 $this->value = $value;
32 }
33
34 public function dump() {
35 return "<{$this->type}>" . htmlspecialchars( $this->value ) . "</{$this->type}>";
36 }
37 }