Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / parser / Hook / ParserGetVariableValueSwitchHook.php
blob733431bcc45f4542eb8f216ce40eabba3885c654
1 <?php
3 namespace MediaWiki\Hook;
5 use MediaWiki\Parser\Parser;
6 use MediaWiki\Parser\PPFrame;
8 /**
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
13 * @ingroup Hooks
15 interface ParserGetVariableValueSwitchHook {
16 /**
17 * This hook is called when the parser needs the value of a
18 * custom magic word.
20 * @since 1.35
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