From bbc88d5f5da1ca609b808649158837175ddc190e Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 7 Apr 2018 21:03:56 +0200 Subject: [PATCH] Fix parameter docs * Removed () from param doc * Fix return type * Changed default type Change-Id: I82d81c99683cb79d60980eaa702c99110af6db94 --- MathHooks.php | 8 ++++---- MathLaTeXML.php | 4 ++-- MathMathML.php | 2 +- MathMathMLCli.php | 2 +- MathRenderer.php | 5 ++--- MathRestbaseInterface.php | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/MathHooks.php b/MathHooks.php index f0d6e7297..5821eb0a1 100644 --- a/MathHooks.php +++ b/MathHooks.php @@ -104,7 +104,7 @@ class MathHooks { * Generate a user dependent hash cache key. * The hash key depends on the rendering mode. * @param string &$confstr The to-be-hashed key string that is being constructed - * @param User $user reference to the current user + * @param User|bool $user reference to the current user * @param array &$forOptions userOptions used on that page * @return true */ @@ -185,7 +185,7 @@ class MathHooks { * @param string $content (the LaTeX input) * @param array $attributes * @param Parser $parser - * @return array + * @return array|string */ static function mathTagHook( $content, $attributes, $parser ) { static $n = 1; @@ -214,9 +214,9 @@ class MathHooks { /** * Callback function for the parser hook. * - * @param Parser $parser * @param MathRenderer $renderer - * @return array + * @param Parser $parser + * @return string * @throws FatalError * @throws MWException */ diff --git a/MathLaTeXML.php b/MathLaTeXML.php index 3f902fdb4..bd4c301db 100644 --- a/MathLaTeXML.php +++ b/MathLaTeXML.php @@ -26,7 +26,7 @@ class MathLaTeXML extends MathMathML { * Converts an array with LaTeXML settings to a URL encoded String. * If the argument is a string the input will be returned. * Thus the function has projector properties and can be applied a second time safely. - * @param (string|array) $array + * @param string|array $array * @return string */ public function serializeSettings( $array ) { @@ -162,7 +162,7 @@ class MathLaTeXML extends MathMathML { * @param string $mml : the MathML string * @param string $tagId : optional tagID for references like (pagename#equation2) * @param bool $attribs - * @return html element with rendered math + * @return string html element with rendered math */ public static function embedMathML( $mml, $tagId = '', $attribs = false ) { $mml = str_replace( "\n", " ", $mml ); diff --git a/MathMathML.php b/MathMathML.php index 92580d536..4db523a4b 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -15,7 +15,7 @@ class MathMathML extends MathRenderer { protected $defaultAllowedRootElements = [ 'math' ]; protected $restbaseInputTypes = [ 'tex', 'inline-tex', 'chem' ]; - protected $allowedRootElements = ''; + protected $allowedRootElements = []; protected $hosts; /** @var bool if false MathML output is not validated */ diff --git a/MathMathMLCli.php b/MathMathMLCli.php index 600428e78..ad0566592 100644 --- a/MathMathMLCli.php +++ b/MathMathMLCli.php @@ -110,7 +110,7 @@ class MathMathMLCli extends MathMathML { } /** - * @param string $req request + * @param mixed $req request * @param int &$exitCode exit code * @return mixed * @throws MWException diff --git a/MathRenderer.php b/MathRenderer.php index 3ef259d69..014d32021 100644 --- a/MathRenderer.php +++ b/MathRenderer.php @@ -34,7 +34,7 @@ abstract class MathRenderer { /** @var string the original user input string (which was used to calculate the inputhash) */ protected $userInputTex = ''; // FURTHER PROPERTIES OF THE MATHEMATICAL CONTENT - /** @var ('inlineDisplaystyle'|'display'|'inline'|'linebreak') the rendering style */ + /** @var string ('inlineDisplaystyle'|'display'|'inline'|'linebreak') the rendering style */ protected $mathStyle = 'inlineDisplaystyle'; /** @var array with userdefined parameters passed to the extension (not used) */ protected $params = []; @@ -204,7 +204,7 @@ abstract class MathRenderer { * Returns an internationalized HTML error string * * @param string $msg message key for specific error - * @internal param \Varargs $parameters (optional) zero + * @note param \Varargs $parameters (optional) zero * or more message parameters for specific error * * @return string HTML error string @@ -233,7 +233,6 @@ abstract class MathRenderer { /** * Set the input hash (if user input tex is not available) * @param string $md5 - * @return string hash */ public function setMd5( $md5 ) { $this->md5 = $md5; diff --git a/MathRestbaseInterface.php b/MathRestbaseInterface.php index 25aae703e..82eabda2a 100644 --- a/MathRestbaseInterface.php +++ b/MathRestbaseInterface.php @@ -117,7 +117,7 @@ class MathRestbaseInterface { * @see Http::post() * * @param array $request the request object - * @return bool success + * @return array */ private function executeRestbaseCheckRequest( $request ) { $res = null;