3 namespace MediaWiki\Content\Hook
;
5 use MediaWiki\Content\Content
;
8 * This is a hook handler interface, see docs/Hooks.md.
9 * Use the hook name "ConvertContent" to register handlers implementing this interface.
11 * @stable to implement
14 interface ConvertContentHook
{
16 * This hook is called by AbstractContent::convert when a conversion to another content model
17 * is requested. Handler functions that modify $result should generally return false to disable
18 * further attempts at conversion.
22 * @param Content $content Content object to be converted
23 * @param string $toModel ID of the content model to convert to
24 * @param bool $lossy Whether lossy conversion is allowed
25 * @param Content|false &$result Output parameter, in case the handler function wants to
26 * provide a converted Content object. Note that $result->getContentModel() must return
28 * @return bool|void True or no return value to continue or false to abort
30 public function onConvertContent( $content, $toModel, $lossy, &$result );