X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FMessageContent.php;h=5626b549ea65af0d0584627407e15e5124eddea0;hb=3871d05366969b1654badb034b8c6c269d662126;hp=4b589893717a1ebc4632a0584891d5e493a48828;hpb=f43fa6f4f0e2cb60b8543daad661b48a3e0653a9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/MessageContent.php b/includes/content/MessageContent.php index 4b58989371..5626b549ea 100644 --- a/includes/content/MessageContent.php +++ b/includes/content/MessageContent.php @@ -42,7 +42,7 @@ class MessageContent extends AbstractContent { /** * @param Message|string $msg A Message object, or a message key. - * @param string[] $params An optional array of message parameters. + * @param string[]|null $params An optional array of message parameters. */ public function __construct( $msg, $params = null ) { # XXX: messages may be wikitext, html or plain text! and maybe even something else entirely. @@ -80,9 +80,22 @@ class MessageContent extends AbstractContent { /** * Returns the message object, with any parameters already substituted. * + * @deprecated since 1.33 use getMessage() instead. + * * @return Message The message object. */ public function getNativeData() { + return $this->getMessage(); + } + + /** + * Returns the message object, with any parameters already substituted. + * + * @since 1.33 + * + * @return Message The message object. + */ + public function getMessage() { // NOTE: Message objects are mutable. Cloning here makes MessageContent immutable. return clone $this->mMessage; } @@ -131,7 +144,8 @@ class MessageContent extends AbstractContent { * @see Content::copy */ public function copy() { - // MessageContent is immutable (because getNativeData() returns a clone of the Message object) + // MessageContent is immutable (because getNativeData() and getMessage() + // returns a clone of the Message object) return $this; } @@ -148,8 +162,8 @@ class MessageContent extends AbstractContent { /** * @param Title $title Unused. - * @param int $revId Unused. - * @param ParserOptions $options Unused. + * @param int|null $revId Unused. + * @param ParserOptions|null $options Unused. * @param bool $generateHtml Whether to generate HTML (default: true). * * @return ParserOutput