3 namespace Wikimedia\Message
;
6 * Value object representing a message parameter holding a single value.
8 * Message parameter classes are pure value objects and are safely newable.
10 class ScalarParam
extends MessageParam
{
12 * Construct a text parameter
14 * @param string $type One of the ParamType constants.
15 * @param string|int|float|MessageValue $value
17 public function __construct( $type, $value ) {
19 $this->value
= $value;
22 public function dump() {
23 if ( $this->value
instanceof MessageValue
) {
24 $contents = $this->value
->dump();
26 $contents = htmlspecialchars( $this->value
);
28 return "<{$this->type}>" . $contents . "</{$this->type}>";