* so that a lack of error-handling will be explicit.
*/
class Status {
+ /** @var bool */
public $ok = true;
+
+ /** @var mixed */
public $value;
/** Counters for batch operations */
+ /** @var int */
public $successCount = 0;
+
+ /** @var int */
public $failCount = 0;
/** Array to indicate which items of the batch operations were successful */
+ /** @var array */
public $success = array();
+ /** @var array */
public $errors = array();
+
+ /** @var callable */
public $cleanCallback = false;
/**
/**
* Get the error message as HTML. This is done by parsing the wikitext error
* message.
- *
- * @note: this does not perform a full wikitext to HTML conversion, it merely applies
- * a message transformation.
- * @todo figure out whether that is actually The Right Thing.
+ * @param string $shortContext a short enclosing context message name, to
+ * be used when there is a single error
+ * @param string $longContext a long enclosing context message name, for a list
+ * @return String
*/
public function getHTML( $shortContext = false, $longContext = false ) {
$text = $this->getWikiText( $shortContext, $longContext );
- return MessageCache::singleton()->transform( $text, true );
+ $out = MessageCache::singleton()->parse( $text, null, true, true );
+ return $out instanceof ParserOutput ? $out->getText() : $out;
}
/**