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.
 
const DATE = 'date'
 A date in one of the formats accepted by the Wikimedia\Timestamp library.
 
const DATETIME = 'datetime'
 A date time in one of the formats accepted by the Wikimedia\Timestamp library.
 
const DURATION_LONG = 'duration'
 A number of seconds, to be formatted as natural language text.
 
const DURATION_SHORT = 'period'
 A number of seconds, to be formatted as natural language text in an abbreviated way.
 
const EXPIRY = 'expiry'
 An expiry time.
 
const GROUP = 'group'
 User Group.
 
const LIST = 'list'
 A list of values.
 
const NUM = 'num'
 A number, to be formatted using local digits and separators.
 
const OBJECT = 'object'
 For arbitrary stringable objects.
 
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.
 
const TIME = 'time'
 A time in one of the formats accepted by the Wikimedia\Timestamp library.
 

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 78 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'

User Group.

Since
1.38

Definition at line 66 of file ParamType.php.

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

◆ LIST

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

A list of values.

Must be used with ListParam.

Definition at line 81 of file ParamType.php.

Referenced by Wikimedia\Message\ListParam\__construct(), and Wikimedia\Message\ScalarParam\__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\ParamValidator\TypeDef\NumericDef\getHelpInfo(), and Wikimedia\Message\MessageValue\numParams().

◆ OBJECT

const Wikimedia\Message\ParamType::OBJECT = 'object'

For arbitrary stringable objects.

Since
1.38

Definition at line 72 of file ParamType.php.

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

◆ 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 97 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 90 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 75 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(), Wikimedia\Message\MessageValue\params(), and Wikimedia\Message\MessageValue\textParams().

◆ 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: