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 DATE = 'date'
 A date in one of the formats accepted by the Wikimedia\Timestamp library. More...
 
const DATETIME = 'datetime'
 A date time in one of the formats accepted by the Wikimedia\Timestamp library. 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 GROUP = 'group'
 
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...
 
const TIME = 'time'
 A time in one of the formats accepted by the Wikimedia\Timestamp library. 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 73 of file ParamType.php.

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

◆ DATE

const Wikimedia\Message\ParamType::DATE = 'date'

A date in one of the formats accepted by the Wikimedia\Timestamp library.

The output is a date in local format.

Definition at line 53 of file ParamType.php.

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

◆ DATETIME

const Wikimedia\Message\ParamType::DATETIME = 'datetime'

A date time in one of the formats accepted by the Wikimedia\Timestamp library.

The output is a date and time in local format.

Definition at line 46 of file ParamType.php.

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

◆ 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().

◆ GROUP

const Wikimedia\Message\ParamType::GROUP = 'group'
Since
1.38

User Group

Definition at line 67 of file ParamType.php.

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

◆ 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 92 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 85 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 70 of file ParamType.php.

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

◆ TEXT

◆ TIME

const Wikimedia\Message\ParamType::TIME = 'time'

A time in one of the formats accepted by the Wikimedia\Timestamp library.

The output is a time in local format.

Definition at line 60 of file ParamType.php.

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


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