/** @var string */
protected $messageParsed;
+ /** @var string */
+ protected $messageRich;
+
+ /** @var array */
+ protected $messageRichParameters;
+
/** @var string */
protected $link;
$this->message = '';
$this->messageParameters = [];
$this->messageParsed = '';
+ $this->messageRich = '';
+ $this->messageRichParameters = [];
$this->link = '';
$this->icon = '';
$this->actions = [];
return $this->messageParsed;
}
+ /**
+ * @param string $message
+ * @param array $parameters
+ * @return $this
+ * @throws \InvalidArgumentException if the message or parameters are invalid
+ * @since 9.2.0
+ */
+ public function setRichMessage($message, array $parameters = []) {
+ if (!is_string($message) || $message === '') {
+ throw new \InvalidArgumentException('The given parsed message is invalid');
+ }
+ $this->messageRich = $message;
+
+ if (!is_array($parameters)) {
+ throw new \InvalidArgumentException('The given message parameters are invalid');
+ }
+ $this->messageRichParameters = $parameters;
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ * @since 9.2.0
+ */
+ public function getRichMessage() {
+ return $this->messageRich;
+ }
+
+ /**
+ * @return array[]
+ * @since 9.2.0
+ */
+ public function getRichMessageParameters() {
+ return $this->messageRichParameters;
+ }
+
/**
* @param string $link
* @return $this
}
}
+ if ($this->getRichMessage() !== '' || !empty($this->getRichMessageParameters())) {
+ try {
+ $this->richValidator->validate($this->getRichMessage(), $this->getRichMessageParameters());
+ } catch (InvalidObjectExeption $e) {
+ return false;
+ }
+ }
+
return
$this->isValidCommon()
&&
*/
public function getParsedMessage();
+ /**
+ * @param string $message
+ * @param array $parameters
+ * @return $this
+ * @throws \InvalidArgumentException if the message or parameters are invalid
+ * @since 9.2.0
+ */
+ public function setRichMessage($message, array $parameters = []);
+
+ /**
+ * @return string
+ * @since 9.2.0
+ */
+ public function getRichMessage();
+
+ /**
+ * @return array[]
+ * @since 9.2.0
+ */
+ public function getRichMessageParameters();
+
/**
* @param string $link
* @return $this