MediaWiki master
RawMessage.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Language;
22
23use InvalidArgumentException;
25
40class RawMessage extends Message {
41
54 public function __construct( $text, $params = [] ) {
55 if ( !is_string( $text ) ) {
56 throw new InvalidArgumentException( '$text must be a string' );
57 }
58
59 parent::__construct( $text, $params );
60
61 // The key is the message.
62 $this->message = $text;
63 }
64
70 public function fetchMessage() {
71 // Just in case the message is unset somewhere.
72 $this->message ??= $this->key;
73
74 return $this->message;
75 }
76
77}
78
82class_alias( RawMessage::class, 'RawMessage' );
Variant of the Message class.
__construct( $text, $params=[])
Call the parent constructor, then store the key as the message.
fetchMessage()
Fetch the message (in this case, the key).
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:157
string $key
The message key.
Definition Message.php:199
string null false $message
Definition Message.php:231