aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/Message/MessageParam.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2019-07-15 20:24:38 +1000
committerTim Starling <tstarling@wikimedia.org>2019-08-28 12:28:05 +1000
commit09cd8eb0807ee7b0a94c674766e2ea201e5d071b (patch)
tree50cefe6e78377459c32e1fadbc6b56fc1fed0800 /includes/libs/Message/MessageParam.php
parent3bb3c8b0ae092b2e667f6f33abfc98f9c205d53c (diff)
downloadmediawikicore-09cd8eb0807ee7b0a94c674766e2ea201e5d071b.tar.gz
mediawikicore-09cd8eb0807ee7b0a94c674766e2ea201e5d071b.zip
MessageFormatterFactory
An injectable service interface for message formatting, somewhat narrowed compared to Message. Only the text format is implemented in this framework so far, with getTextFormatter() returning a formatter that converts to the text format. Other formatters could be added to MessageFormatterFactory. Bug: T226598 Change-Id: Id053074c1dbcb692e8309fdca602f94a385bca0c
Diffstat (limited to 'includes/libs/Message/MessageParam.php')
-rw-r--r--includes/libs/Message/MessageParam.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/includes/libs/Message/MessageParam.php b/includes/libs/Message/MessageParam.php
new file mode 100644
index 000000000000..8162212c0687
--- /dev/null
+++ b/includes/libs/Message/MessageParam.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Wikimedia\Message;
+
+/**
+ * The base class for message parameters.
+ */
+abstract class MessageParam {
+ protected $type;
+ 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
+ *
+ * @return int|float|string|array
+ */
+ public function getValue() {
+ return $this->value;
+ }
+
+ /**
+ * Dump the object for testing/debugging
+ *
+ * @return string
+ */
+ abstract public function dump();
+}