2019-07-15 10:24:38 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Wikimedia\Message;
|
|
|
|
|
|
2024-04-02 21:56:24 +00:00
|
|
|
use MediaWiki\Json\JsonDeserializable;
|
|
|
|
|
use MediaWiki\Json\JsonDeserializableTrait;
|
|
|
|
|
|
2019-07-15 10:24:38 +00:00
|
|
|
/**
|
2019-08-29 20:52:27 +00:00
|
|
|
* Value object representing a message parameter that consists of a list of values.
|
|
|
|
|
*
|
2024-04-02 21:56:24 +00:00
|
|
|
* Message parameter classes are pure value objects and are newable and (de)serializable.
|
2019-07-15 10:24:38 +00:00
|
|
|
*/
|
2024-04-02 21:56:24 +00:00
|
|
|
abstract class MessageParam implements JsonDeserializable {
|
|
|
|
|
use JsonDeserializableTrait;
|
|
|
|
|
|
2024-09-12 20:19:27 +00:00
|
|
|
/** @var string */
|
2019-07-15 10:24:38 +00:00
|
|
|
protected $type;
|
2024-09-12 20:19:27 +00:00
|
|
|
/** @var mixed */
|
2019-07-15 10:24:38 +00:00
|
|
|
protected $value;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the type of the parameter.
|
|
|
|
|
*
|
|
|
|
|
* @return string One of the ParamType constants
|
|
|
|
|
*/
|
|
|
|
|
public function getType() {
|
|
|
|
|
return $this->type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the input value of the parameter
|
|
|
|
|
*
|
2019-08-29 20:52:27 +00:00
|
|
|
* @return mixed
|
2019-07-15 10:24:38 +00:00
|
|
|
*/
|
|
|
|
|
public function getValue() {
|
|
|
|
|
return $this->value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Dump the object for testing/debugging
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
abstract public function dump();
|
|
|
|
|
}
|