1<?php 2 3namespace Wikimedia\Message; 4 5/** 6 * The constants used to specify parameter types. The values of the constants 7 * are an unstable implementation detail. 8 * 9 * Unless otherwise noted, these should be used with an instance of ScalarParam. 10 */ 11class ParamType { 12 /** A simple text string or another MessageValue, not otherwise formatted. */ 13 public const TEXT = 'text'; 14 15 /** A number, to be formatted using local digits and separators */ 16 public const NUM = 'num'; 17 18 /** 19 * A number of seconds, to be formatted as natural language text. 20 * The value will be output exactly. 21 */ 22 public const DURATION_LONG = 'duration'; 23 24 /** 25 * A number of seconds, to be formatted as natural language text in an abbreviated way. 26 * The output will be rounded to an appropriate magnitude. 27 */ 28 public const DURATION_SHORT = 'period'; 29 30 /** 31 * An expiry time. 32 * 33 * The input is either a timestamp in one of the formats accepted by the 34 * Wikimedia\Timestamp library, or "infinity" if the thing doesn't expire. 35 * 36 * The output is a date and time in local format, or a string representing 37 * an "infinite" expiry. 38 */ 39 public const EXPIRY = 'expiry'; 40 41 /** A number of bytes. The output will be rounded to an appropriate magnitude. */ 42 public const SIZE = 'size'; 43 44 /** A number of bits per second. The output will be rounded to an appropriate magnitude. */ 45 public const BITRATE = 'bitrate'; 46 47 /** A list of values. Must be used with ListParam. */ 48 public const LIST = 'list'; 49 50 /** 51 * A text parameter which is substituted after formatter processing. 52 * 53 * The creator of the parameter and message is responsible for ensuring 54 * that the value will be safe for the intended output format, and 55 * documenting what that intended output format is. 56 */ 57 public const RAW = 'raw'; 58 59 /** 60 * A text parameter which is substituted after formatter processing. 61 * The output will be escaped as appropriate for the output format so 62 * as to represent plain text rather than any sort of markup. 63 */ 64 public const PLAINTEXT = 'plaintext'; 65} 66