3 namespace MediaWiki\Hook
;
5 use MediaWiki\Parser\Parser
;
6 use MediaWiki\Parser\PPFrame
;
9 * This is a hook handler interface, see docs/Hooks.md.
10 * Use the hook name "ParserGetVariableValueSwitch" to register handlers implementing this interface.
12 * @stable to implement
15 interface ParserGetVariableValueSwitchHook
{
17 * This hook is called when the parser needs the value of a
22 * @param Parser $parser
23 * @param array &$variableCache Array to cache the value; when you return
24 * $variableCache[$magicWordId] should be the same as $ret
25 * @param string $magicWordId Index of the magic word (hook should not mutate it!)
26 * @param string &$ret Value of the magic word (the hook should set it)
27 * @param PPFrame $frame PPFrame object to use for expanding any template variables
28 * @return bool|void True or no return value to continue or false to abort
29 * @note Setting $variableCache[$magicWordId] is no longer necessary since
30 * MW 1.39, but hooks may wish to do so for backward compatibility.
32 public function onParserGetVariableValueSwitch( $parser, &$variableCache,
33 $magicWordId, &$ret, $frame