X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/content/JsonContentHandler.php diff --git a/includes/content/JsonContentHandler.php b/includes/content/JsonContentHandler.php new file mode 100644 index 00000000..edb21f68 --- /dev/null +++ b/includes/content/JsonContentHandler.php @@ -0,0 +1,47 @@ + + * @author Kunal Mehta + * + * @since 1.24 + * @ingroup Content + */ +class JsonContentHandler extends CodeContentHandler { + + public function __construct( $modelId = CONTENT_MODEL_JSON ) { + parent::__construct( $modelId, [ CONTENT_FORMAT_JSON ] ); + } + + /** + * @return string + */ + protected function getContentClass() { + return JsonContent::class; + } + + public function makeEmptyContent() { + $class = $this->getContentClass(); + return new $class( '{}' ); + } +}