MediaWiki  master
Wikimedia\Message\ParamType Class Reference

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

Public Attributes

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

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 = 'period'

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'

◆ 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\ParamValidator\TypeDef\NumericDef\getHelpInfo(), and 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(), Wikimedia\ParamValidator\TypeDef\EnumDef\validate(), and Wikimedia\ParamValidator\ParamValidator\validateValue().

◆ 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


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