/**
* Factory function for fatal errors
*
- * @param string|Message $message message name or object
+ * @param string|Message $message Message name or object
* @return Status
*/
static function newFatal( $message /*, parameters...*/ ) {
$this->ok = false;
}
+ /**
+ * Don't save the callback when serializing, because Closures can't be
+ * serialized and we're going to clear it in __wakeup anyway.
+ */
+ public function __sleep() {
+ $keys = array_keys( get_object_vars( $this ) );
+ return array_diff( $keys, array( 'cleanCallback' ) );
+ }
+
/**
* Sanitize the callback parameter on wakeup, to avoid arbitrary execution.
*/
/**
* Get the error list as a wikitext formatted list
*
- * @param string $shortContext A short enclosing context message name, to
+ * @param string|bool $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
+ * @param string|bool $longContext A long enclosing context message name, for a list
* @return string
*/
public function getWikiText( $shortContext = false, $longContext = false ) {