class WikitextContentHandler extends TextContentHandler {
public function __construct( $modelId = CONTENT_MODEL_WIKITEXT ) {
- parent::__construct( $modelId, array( CONTENT_FORMAT_WIKITEXT ) );
+ parent::__construct( $modelId, [ CONTENT_FORMAT_WIKITEXT ] );
}
- public function unserializeContent( $text, $format = null ) {
- $this->checkFormat( $format );
-
- return new WikitextContent( $text );
- }
-
- /**
- * @return Content A new WikitextContent object with empty text.
- *
- * @see ContentHandler::makeEmptyContent
- */
- public function makeEmptyContent() {
- return new WikitextContent( '' );
+ protected function getContentClass() {
+ return 'WikitextContent';
}
/**
$redirectText .= "\n" . $text;
}
- return new WikitextContent( $redirectText );
+ $class = $this->getContentClass();
+ return new $class( $redirectText );
}
/**