MediaWiki master
|
Value object representing a message parameter holding a single value. More...
Inherits Wikimedia\Message\MessageParam.
Public Member Functions | |
__construct ( $type, $value) | |
Construct a text parameter. | |
dump () | |
Dump the object for testing/debugging. | |
toJsonArray () | |
Public Member Functions inherited from Wikimedia\Message\MessageParam | |
getType () | |
Get the type of the parameter. | |
getValue () | |
Get the input value of the parameter. | |
Static Public Member Functions | |
static | newFromJsonArray (JsonDeserializer $deserializer, array $json) |
Creates a new instance of the class and initialized it from the $json array. | |
Additional Inherited Members | |
Protected Attributes inherited from Wikimedia\Message\MessageParam | |
$type | |
$value | |
Value object representing a message parameter holding a single value.
Message parameter classes are pure value objects and are safely newable.
When using the deprecated ParamType::OBJECT, the parameter value should be (de)serializable, otherwise (de)serialization of the ScalarParam object will fail.
Definition at line 20 of file ScalarParam.php.
Wikimedia\Message\ScalarParam::__construct | ( | $type, | |
$value ) |
Construct a text parameter.
string | $type | One of the ParamType constants. Using ParamType::OBJECT is deprecated since 1.43. |
string | int | float | MessageValue | Stringable | $value |
Definition at line 30 of file ScalarParam.php.
References Wikimedia\Message\MessageParam\$type, Wikimedia\Message\MessageParam\$value, Wikimedia\Message\ParamType\LIST, Wikimedia\Message\ParamType\OBJECT, and wfDeprecatedMsg().
Wikimedia\Message\ScalarParam::dump | ( | ) |
Dump the object for testing/debugging.
Reimplemented from Wikimedia\Message\MessageParam.
Definition at line 54 of file ScalarParam.php.
|
static |
Creates a new instance of the class and initialized it from the $json array.
JsonDeserializer | $deserializer | an instance of JsonDeserializer to use for nested properties if they need special care. |
array | $json |
Implements MediaWiki\Json\JsonDeserializable.
Definition at line 71 of file ScalarParam.php.
Wikimedia\Message\ScalarParam::toJsonArray | ( | ) |
Definition at line 63 of file ScalarParam.php.