<?php
-
/**
- * Wrapper allowing us to handle a system message as a Content object. Note that this is generally *not* used
- * to represent content from the MediaWiki namespace, and that there is no MessageContentHandler. MessageContent
- * is just intended as glue for wrapping a message programatically.
+ * Wrapper content object allowing to handle a system message as a Content object.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* @author Daniel Kinzler
*/
+
+/**
+ * Wrapper allowing us to handle a system message as a Content object.
+ * Note that this is generally *not* used to represent content from the
+ * MediaWiki namespace, and that there is no MessageContentHandler.
+ * MessageContent is just intended as glue for wrapping a message programatically.
+ *
+ * @ingroup Content
+ */
class MessageContent extends AbstractContent {
/**
protected $mMessage;
/**
- * @param Message|String $msg A Message object, or a message key
- * @param array|null $params An optional array of message parameters
+ * @param Message|string $msg A Message object, or a message key.
+ * @param string[] $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.
}
/**
- * Returns the message as rendered HTML
+ * Fully parse the text from wikitext to HTML.
*
- * @return string The message text, parsed into html
+ * @return string Parsed HTML.
*/
public function getHtml() {
return $this->mMessage->parse();
}
/**
- * Returns the message as rendered HTML
+ * Returns the message text. {{-transformation is done.
*
- * @return string The message text, parsed into html
+ * @return string Unescaped message text.
*/
public function getWikitext() {
return $this->mMessage->text();
}
/**
+ * @return string
+ *
* @see Content::getTextForSearchIndex
*/
public function getTextForSearchIndex() {
}
/**
+ * @return string
+ *
* @see Content::getWikitextForTransclusion
*/
public function getWikitextForTransclusion() {
}
/**
+ * @param int $maxLength Maximum length of the summary text, defaults to 250.
+ *
+ * @return string The summary text.
+ *
* @see Content::getTextForSummary
*/
public function getTextForSummary( $maxlength = 250 ) {
}
/**
- * @see Content::getSize
- *
* @return int
+ *
+ * @see Content::getSize
*/
public function getSize() {
return strlen( $this->mMessage->plain() );
}
/**
- * @see Content::copy
- *
* @return Content. A copy of this object
+ *
+ * @see Content::copy
*/
public function copy() {
// MessageContent is immutable (because getNativeData() returns a clone of the Message object)
}
/**
- * @see Content::isCountable
+ * @param bool $hasLinks
+ *
+ * @return bool Always false.
*
- * @return bool false
+ * @see Content::isCountable
*/
public function isCountable( $hasLinks = null ) {
return false;
}
/**
- * @see Content::getParserOutput
+ * @param Title $title Unused.
+ * @param int $revId Unused.
+ * @param ParserOptions $options Unused.
+ * @param bool $generateHtml Whether to generate HTML (default: true).
*
* @return ParserOutput
+ *
+ * @see Content::getParserOutput
*/
- public function getParserOutput(
- Title $title, $revId = null,
- ParserOptions $options = null, $generateHtml = true
- ) {
-
+ public function getParserOutput( Title $title, $revId = null,
+ ParserOptions $options = null, $generateHtml = true ) {
if ( $generateHtml ) {
$html = $this->getHtml();
} else {
}
$po = new ParserOutput( $html );
+
return $po;
}
-}
\ No newline at end of file
+
+}