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 | |
3 | namespace MediaWiki\Linker\Hook; |
4 | |
5 | use MediaWiki\Context\IContextSource; |
6 | use MediaWiki\User\UserIdentity; |
7 | |
8 | /** |
9 | * This is a hook handler interface, see docs/Hooks.md. |
10 | * Use the hook name "UserLinkRendererUserLinkPostRender" to register handlers implementing this interface. |
11 | * |
12 | * @stable to implement |
13 | * @ingroup Hooks |
14 | */ |
15 | interface UserLinkRendererUserLinkPostRenderHook { |
16 | |
17 | /** |
18 | * This hook is called after the username link HTML has been generated, and allows for |
19 | * adding prefix or postfix HTML. Note that this hook may be called hundreds of times |
20 | * in a given request, so hook handlers implementations should consider performance |
21 | * of any code invoked in the handler. |
22 | * |
23 | * @since 1.45 |
24 | * |
25 | * @param UserIdentity $targetUser The user associated with the rendered username link HTML. |
26 | * @param IContextSource $context The context for viewing the username. |
27 | * @param string &$html The username link HTML generated by UserLinkRenderer |
28 | * @param string &$prefix An HTML fragment to add as a prefix to &$html |
29 | * @param string &$postfix An HTML fragment to add as a postfix to &$html |
30 | * @return bool|void True or no return value to continue, or false to stop further processing |
31 | * and return $&html, &$prefix and &$postfix |
32 | */ |
33 | public function onUserLinkRendererUserLinkPostRender( |
34 | UserIdentity $targetUser, |
35 | IContextSource $context, |
36 | string &$html, |
37 | string &$prefix, |
38 | string &$postfix |
39 | ); |
40 | |
41 | } |