mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-28 09:20:42 +00:00
Update a few type hints
Some random bits I found while working on some other code. Change-Id: I29be84cb54e05af5030defd99cb1f42f9c6a5b63
This commit is contained in:
parent
e4577337d5
commit
56ad7ff334
|
@ -218,6 +218,9 @@ class MathLaTeXML extends MathMathML {
|
|||
return parent::getSvg( $render );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getMathTableName() {
|
||||
return 'mathlatexml';
|
||||
}
|
||||
|
|
|
@ -262,7 +262,7 @@ class MathHooks {
|
|||
/**
|
||||
* List of message keys for the various math output settings.
|
||||
*
|
||||
* @return array of strings
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getMathNames() {
|
||||
$names = [];
|
||||
|
|
|
@ -467,6 +467,9 @@ class MathMathML extends MathRenderer {
|
|||
] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getMathTableName() {
|
||||
return 'mathoid';
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ abstract class MathRenderer {
|
|||
|
||||
/**
|
||||
* @param string $md5
|
||||
* @return MathRenderer the MathRenderer generated from md5
|
||||
* @return self the MathRenderer generated from md5
|
||||
*/
|
||||
public static function newFromMd5( $md5 ) {
|
||||
$class = get_called_class();
|
||||
|
@ -147,7 +147,7 @@ abstract class MathRenderer {
|
|||
* @param string $tex LaTeX markup
|
||||
* @param array $params HTML attributes
|
||||
* @param string $mode indicating rendering mode
|
||||
* @return MathRenderer appropriate renderer for mode
|
||||
* @return self appropriate renderer for mode
|
||||
*/
|
||||
public static function getRenderer( $tex, $params = [], $mode = 'png' ) {
|
||||
global $wgDefaultUserOptions, $wgMathEnableExperimentalInputFormats, $wgMathoidCli;
|
||||
|
@ -700,6 +700,9 @@ abstract class MathRenderer {
|
|||
return trim( $this->svg );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract protected function getMathTableName();
|
||||
|
||||
public function getModeStr() {
|
||||
|
|
|
@ -55,6 +55,9 @@ class MathSource extends MathRenderer {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception always
|
||||
*/
|
||||
protected function getMathTableName() {
|
||||
throw new Exception( 'in math source mode no database caching should happen' );
|
||||
}
|
||||
|
|
|
@ -47,18 +47,18 @@ class SpecialMathStatus extends SpecialPage {
|
|||
}
|
||||
|
||||
private function runMathMLTest( $modeName ) {
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-start', $modeName );
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-start', [ $modeName ] );
|
||||
$this->testSpecialCaseText();
|
||||
$this->testMathMLIntegration();
|
||||
$this->testPmmlInput();
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-end', $modeName );
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-end', [ $modeName ] );
|
||||
}
|
||||
|
||||
private function runMathLaTeXMLTest( $modeName ) {
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-start', $modeName );
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-start', [ $modeName ] );
|
||||
$this->testLaTeXMLIntegration();
|
||||
$this->testLaTeXMLLinebreak();
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-end', $modeName );
|
||||
$this->getOutput()->addWikiMsgArray( 'math-test-end', [ $modeName ] );
|
||||
}
|
||||
|
||||
public function testSpecialCaseText() {
|
||||
|
|
Loading…
Reference in a new issue