MediaWiki REL1_35
RawMessage.php
Go to the documentation of this file.
1<?php
35class RawMessage extends Message {
36
49 public function __construct( $text, $params = [] ) {
50 if ( !is_string( $text ) ) {
51 throw new InvalidArgumentException( '$text must be a string' );
52 }
53
54 parent::__construct( $text, $params );
55
56 // The key is the message.
57 $this->message = $text;
58 }
59
65 public function fetchMessage() {
66 // Just in case the message is unset somewhere.
67 if ( $this->message === null ) {
68 $this->message = $this->key;
69 }
70
71 return $this->message;
72 }
73
74}
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:161
Variant of the Message class.
fetchMessage()
Fetch the message (in this case, the key).
__construct( $text, $params=[])
Call the parent constructor, then store the key as the message.