MediaWiki REL1_34
Wikimedia\Message\ParamType Class Reference

The constants used to specify parameter types. More...

Public Attributes

const BITRATE = 'bitrate'
 A number of bits per second.
 
const DURATION_LONG = 'duration'
 A number of seconds, to be formatted as natural language text.
 
const DURATION_SHORT = 'timeperiod'
 A number of seconds, to be formatted as natural language text in an abbreviated way.
 
const EXPIRY = 'expiry'
 An expiry time.
 
const LIST = 'list'
 A list of values.
 
const NUM = 'num'
 A number, to be formatted using local digits and separators.
 
const PLAINTEXT = 'plaintext'
 A text parameter which is substituted after formatter processing.
 
const RAW = 'raw'
 A text parameter which is substituted after formatter processing.
 
const SIZE = 'size'
 A number of bytes.
 
const TEXT = 'text'
 A simple text string or another MessageValue, not otherwise formatted.
 

Detailed Description

The constants used to specify parameter types.

The values of the constants are an unstable implementation detail.

Unless otherwise noted, these should be used with an instance of ScalarParam.

Definition at line 11 of file ParamType.php.

Member Data Documentation

◆ BITRATE

const Wikimedia\Message\ParamType::BITRATE = 'bitrate'

A number of bits per second.

The output will be rounded to an appropriate magnitude.

Definition at line 45 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\bitrateParams().

◆ DURATION_LONG

const Wikimedia\Message\ParamType::DURATION_LONG = 'duration'

A number of seconds, to be formatted as natural language text.

The value will be output exactly.

Definition at line 22 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\longDurationParams().

◆ DURATION_SHORT

const Wikimedia\Message\ParamType::DURATION_SHORT = 'timeperiod'

A number of seconds, to be formatted as natural language text in an abbreviated way.

The output will be rounded to an appropriate magnitude.

Definition at line 28 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\shortDurationParams().

◆ EXPIRY

const Wikimedia\Message\ParamType::EXPIRY = 'expiry'

An expiry time.

The input is either a timestamp in one of the formats accepted by the Wikimedia\Timestamp library, or "infinity" if the thing doesn't expire.

The output is a date and time in local format, or a string representing an "infinite" expiry.

Definition at line 39 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\expiryParams().

◆ LIST

const Wikimedia\Message\ParamType::LIST = 'list'

A list of values.

Must be used with ListParam.

Definition at line 48 of file ParamType.php.

Referenced by Wikimedia\Message\ListParam\__construct().

◆ NUM

const Wikimedia\Message\ParamType::NUM = 'num'

A number, to be formatted using local digits and separators.

Definition at line 16 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\numParams().

◆ PLAINTEXT

const Wikimedia\Message\ParamType::PLAINTEXT = 'plaintext'

A text parameter which is substituted after formatter processing.

The output will be escaped as appropriate for the output format so as to represent plain text rather than any sort of markup.

Definition at line 64 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\plaintextParams().

◆ RAW

const Wikimedia\Message\ParamType::RAW = 'raw'

A text parameter which is substituted after formatter processing.

The creator of the parameter and message is responsible for ensuring that the value will be safe for the intended output format, and documenting what that intended output format is.

Definition at line 57 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\rawParams().

◆ SIZE

const Wikimedia\Message\ParamType::SIZE = 'size'

A number of bytes.

The output will be rounded to an appropriate magnitude.

Definition at line 42 of file ParamType.php.

Referenced by Wikimedia\Message\MessageValue\sizeParams().

◆ TEXT

const Wikimedia\Message\ParamType::TEXT = 'text'

A simple text string or another MessageValue, not otherwise formatted.

Definition at line 13 of file ParamType.php.

Referenced by Wikimedia\Message\ListParam\__construct(), MediaWiki\Message\TextFormatter\convertParam(), Wikimedia\Message\MessageValue\params(), and Wikimedia\Message\MessageValue\textParams().


The documentation for this class was generated from the following file: