MediaWiki  1.34.0
RawMessage.php
Go to the documentation of this file.
1 <?php
34 class RawMessage extends Message {
35 
47  public function __construct( $text, $params = [] ) {
48  if ( !is_string( $text ) ) {
49  throw new InvalidArgumentException( '$text must be a string' );
50  }
51 
52  parent::__construct( $text, $params );
53 
54  // The key is the message.
55  $this->message = $text;
56  }
57 
63  public function fetchMessage() {
64  // Just in case the message is unset somewhere.
65  if ( $this->message === null ) {
66  $this->message = $this->key;
67  }
68 
69  return $this->message;
70  }
71 
72 }
RawMessage\__construct
__construct( $text, $params=[])
Call the parent constructor, then store the key as the message.
Definition: RawMessage.php:47
Message
RawMessage
Variant of the Message class.
Definition: RawMessage.php:34
RawMessage\fetchMessage
fetchMessage()
Fetch the message (in this case, the key).
Definition: RawMessage.php:63