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\Hook;
4
5use File;
6use MediaWiki\Linker\DummyLinker;
7use MediaWiki\Parser\Parser;
8use MediaWiki\Title\Title;
9
10/**
11 * This is a hook handler interface, see docs/Hooks.md.
12 * Use the hook name "ImageBeforeProduceHTML" to register handlers implementing this interface.
13 *
14 * @stable to implement
15 * @ingroup Hooks
16 */
17interface ImageBeforeProduceHTMLHook {
18    /**
19     * This hook is called before producing the HTML created by a wiki image insertion.
20     * You can skip the default logic entirely by returning false, or just modify a few
21     * things using call-by-reference.
22     *
23     * @since 1.35
24     *
25     * @param DummyLinker $linker Deprecated, do not use.
26     * @param Title &$title Title object of the image
27     * @param File|false &$file File object, or false if it doesn't exist
28     * @param array &$frameParams Various parameters with special meanings; see documentation in
29     *   includes/Linker.php for Linker::makeImageLink
30     * @param array &$handlerParams Various parameters with special meanings; see documentation in
31     *   includes/Linker.php for Linker::makeImageLink
32     * @param string|bool &$time Timestamp of file in 'YYYYMMDDHHIISS' string
33     *   form, or false for current
34     * @param string &$res Final HTML output, used if you return false
35     * @param Parser $parser
36     * @param string &$query Query params for desc URL
37     * @param string &$widthOption Used by the parser to remember the user preference thumbnailsize
38     * @return bool|void True or no return value to continue or false to skip the default logic
39     */
40    public function onImageBeforeProduceHTML( $linker, &$title, &$file,
41        &$frameParams, &$handlerParams, &$time, &$res, $parser, &$query, &$widthOption
42    );
43}