wiki.techinc.nl/includes/content/Hook/JsonValidateSaveHook.php
Ebrahim Byagowi 848a9f279f Add namespace and deprecation alias to JsonContent
This patch introduces a namespace declaration for the
MediaWiki\Content to JsonContent and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: I44abb1ab5bd1fabf9886dc1457e241d7cae068bc
2024-05-20 18:57:07 +03:30

30 lines
940 B
PHP

<?php
namespace MediaWiki\Content\Hook;
use MediaWiki\Content\JsonContent;
use MediaWiki\Page\PageIdentity;
use StatusValue;
/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "JsonValidateSaveHook" to register handlers implementing this interface.
*
* @stable to implement
* @ingroup Hooks
*/
interface JsonValidateSaveHook {
/**
* Use this hook to add additional validations for JSON content pages.
* This hook is only called if JSON syntax validity and other contentmodel-specific validations
* are passing.
*
* @since 1.39
*
* @param JsonContent $content
* @param PageIdentity $pageIdentity
* @param StatusValue $status Fatal errors only would trigger validation failure as $status is checked with isOK()
* @return bool|void True or no return value to continue
*/
public function onJsonValidateSave( JsonContent $content, PageIdentity $pageIdentity, StatusValue $status );
}