Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace MediaWiki\Content\Hook;
4
5use Content;
6
7/**
8 * This is a hook handler interface, see docs/Hooks.md.
9 * Use the hook name "ConvertContent" to register handlers implementing this interface.
10 *
11 * @stable to implement
12 * @ingroup Hooks
13 */
14interface ConvertContentHook {
15    /**
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.
19     *
20     * @since 1.35
21     *
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
27     *   $toModel.
28     * @return bool|void True or no return value to continue or false to abort
29     */
30    public function onConvertContent( $content, $toModel, $lossy, &$result );
31}