MediaWiki master
Wikimedia\Message\ScalarParam Class Reference

Value object representing a message parameter holding a single value. More...

Inherits Wikimedia\Message\MessageParam.

Collaboration diagram for Wikimedia\Message\ScalarParam:

Public Member Functions

 __construct (string|ParamType $type, $value)
 Construct a text parameter.
 
 dump ()
 Dump the object for testing/debugging.
 
 isSameAs (MessageParam $mp)
 Equality testing.
 
 toJsonArray ()
 
- Public Member Functions inherited from Wikimedia\Message\MessageParam
 __wakeup ()
 
 getType ()
 Get the type of the parameter.
 
 getValue ()
 Get the input value of the parameter.
 

Static Public Member Functions

static jsonClassHintFor (string $keyName)
 
static newFromJsonArray (array $json)
 
- Static Public Member Functions inherited from Wikimedia\Message\MessageParam
static hint ()
 If you are serializing a MessageParam, use this JsonCodec hint to suppress unnecessary type information.
 

Additional Inherited Members

- Protected Attributes inherited from Wikimedia\Message\MessageParam
ParamType $type
 
mixed $value
 

Detailed Description

Value object representing a message parameter holding a single value.

Message parameter classes are pure value objects and are safely newable.

Stability: newable

Definition at line 15 of file ScalarParam.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Message\ScalarParam::__construct ( string|ParamType $type,
$value )

Construct a text parameter.

Stability: stable
to call.
Parameters
string | ParamType$typeOne of the ParamType constants.
string | int | float | MessageSpecifier | Stringable$value

Definition at line 25 of file ScalarParam.php.

References Wikimedia\Message\MessageParam\$type, Wikimedia\Message\MessageParam\$value, Wikimedia\Message\MessageValue\newFromSpecifier(), and wfDeprecated().

Member Function Documentation

◆ dump()

Wikimedia\Message\ScalarParam::dump ( )

Dump the object for testing/debugging.

Returns
string

Reimplemented from Wikimedia\Message\MessageParam.

Definition at line 59 of file ScalarParam.php.

◆ isSameAs()

Wikimedia\Message\ScalarParam::isSameAs ( MessageParam $mp)

Equality testing.

Reimplemented from Wikimedia\Message\MessageParam.

Definition at line 68 of file ScalarParam.php.

◆ jsonClassHintFor()

static Wikimedia\Message\ScalarParam::jsonClassHintFor ( string $keyName)
static

Reimplemented from Wikimedia\Message\MessageParam.

Definition at line 88 of file ScalarParam.php.

Referenced by Wikimedia\Message\MessageParam\jsonClassHintFor().

◆ newFromJsonArray()

static Wikimedia\Message\ScalarParam::newFromJsonArray ( array $json)
static

Reimplemented from Wikimedia\Message\MessageParam.

Definition at line 95 of file ScalarParam.php.

◆ toJsonArray()

Wikimedia\Message\ScalarParam::toJsonArray ( )

Definition at line 79 of file ScalarParam.php.


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