From 0d55341ff96d4bb2bb9ee959e64c83d966d55e33 Mon Sep 17 00:00:00 2001 From: physikerwelt Date: Tue, 19 Apr 2016 16:13:42 -0400 Subject: [PATCH] Fix: Convert all array() syntax to [] The signature of the Hook function is not respected. Thus parameters need to be passed by reference explicitly. For syntax validation to pass, this requires mediawiki-codesniffer to 0.6.0 Change-Id: I90b6501000200c1b462407b769113358eb5c762f --- Math.hooks.php | 2 +- MathLaTeXML.php | 2 +- MathMathML.php | 2 +- MathTexvc.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Math.hooks.php b/Math.hooks.php index f7fe018..2e9ad33 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -230,7 +230,7 @@ class MathHooks { return $renderer->getLastError(); } Hooks::run( 'MathFormulaPostRender', - [ $parser, $renderer, $renderedMath ] );// Enables indexing of math formula + [ $parser, $renderer, &$renderedMath ] );// Enables indexing of math formula // Writes cache if rendering was successful $renderer->writeCache(); diff --git a/MathLaTeXML.php b/MathLaTeXML.php index 755920e..765342e 100644 --- a/MathLaTeXML.php +++ b/MathLaTeXML.php @@ -117,7 +117,7 @@ class MathLaTeXML extends MathMathML { if ( $this->isValidMathML( $jsonResult->result ) ) { $this->setMathml( $jsonResult->result ); Hooks::run( 'MathRenderingResultRetrieved', - [ $this, $jsonResult ] );// Enables debugging of server results + [ &$this, &$jsonResult ] );// Enables debugging of server results return true; } else { // Do not print bad mathml. It's probably too verbose and might diff --git a/MathMathML.php b/MathMathML.php index 48dedb7..64fe5d7 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -513,7 +513,7 @@ class MathMathML extends MathRenderer { $this->setMathml( $jsonResult->mml ); } Hooks::run( 'MathRenderingResultRetrieved', - [ $this, $jsonResult ] ); // Enables debugging of server results + [ &$this, &$jsonResult ] ); // Enables debugging of server results return true; } else { $this->lastError = $this->getError( 'math_unknown_error', $host ); diff --git a/MathTexvc.php b/MathTexvc.php index a3192fc..8a1bc29 100644 --- a/MathTexvc.php +++ b/MathTexvc.php @@ -270,7 +270,7 @@ class MathTexvc extends MathRenderer { $this->setHash( $newHash ); } - Hooks::run( 'MathAfterTexvc', [ $this, $errmsg ] ); + Hooks::run( 'MathAfterTexvc', [ &$this, &$errmsg ] ); if ( $errmsg ) { return $errmsg;