docs: Update ParserGetVariableValueSwitch documentation

It never makes sense to pass a (possibly different) Parser or PPFrame
object *back* as a reference. The & are a relic from very old PHP
versions that cloned all objects before passing them. This is not
needed any more.

Change-Id: I9fdb184cb41a61842819d44c9f07bd9cf435bb14
This commit is contained in:
Thiemo Kreuz 2019-09-10 10:40:06 +02:00
parent e9daa066fe
commit 946f35705b
2 changed files with 7 additions and 7 deletions

View file

@ -2586,12 +2586,12 @@ $rev: Revision object of the template
'ParserGetVariableValueSwitch': Called when the parser need the value of a
custom magic word
&$parser: Parser object
&$varCache: array to store the value in case of multiples calls of the
$parser: Parser object
&$variableCache: array to store the value in case of multiples calls of the
same magic word
&$index: index (string) of the magic
&$magicWordId: index (string) of the magic word
&$ret: value of the magic word (the hook should set it)
&$frame: PPFrame object to use for expanding any template variables
$frame: PPFrame object to use for expanding any template variables
'ParserGetVariableValueTs': Use this to change the value of the time for the
{{LOCAL...}} magic word.

View file

@ -49,9 +49,9 @@ function wfAddCustomMagicWordID( &$magicWords ) {
return true;
}
function wfGetCustomMagicWordValue( &$parser, &$varCache, &$index, &$ret ){
if( $index == 'mag_custom' ){
$ret = $varCache['mag_custom'] = "Custom value";
function wfGetCustomMagicWordValue( $parser, &$variableCache, &$magicWordId, &$ret ){
if( $magicWordId == 'mag_custom' ){
$ret = $variableCache['mag_custom'] = "Custom value";
}
return true;
}