mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 23:25:02 +00:00
Merge "build: Updating mediawiki/mediawiki-phan-config to 0.9.0"
This commit is contained in:
commit
6f347e7b34
|
@ -4,7 +4,7 @@
|
||||||
"mediawiki/mediawiki-codesniffer": "28.0.0",
|
"mediawiki/mediawiki-codesniffer": "28.0.0",
|
||||||
"jakub-onderka/php-console-highlighter": "0.3.2",
|
"jakub-onderka/php-console-highlighter": "0.3.2",
|
||||||
"mediawiki/minus-x": "0.3.2",
|
"mediawiki/minus-x": "0.3.2",
|
||||||
"mediawiki/mediawiki-phan-config": "0.8.0"
|
"mediawiki/mediawiki-phan-config": "0.9.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": [
|
"test": [
|
||||||
|
|
|
@ -77,6 +77,7 @@ class MathGenerateTests extends Maintenance {
|
||||||
}
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ( array_slice( $allEquations, $offset, $length, true ) as $input ) {
|
foreach ( array_slice( $allEquations, $offset, $length, true ) as $input ) {
|
||||||
|
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
|
||||||
$output = MathRenderer::renderMath( $input[1], $input[2], 'png' );
|
$output = MathRenderer::renderMath( $input[1], $input[2], 'png' );
|
||||||
$output = preg_replace( '#src="(.*?)/(([a-f]|\d)*)"#', 'src="\2"', $output );
|
$output = preg_replace( '#src="(.*?)/(([a-f]|\d)*)"#', 'src="\2"', $output );
|
||||||
$parserTests[] = [
|
$parserTests[] = [
|
||||||
|
|
|
@ -32,7 +32,7 @@ class MathInputCheckRestbase extends MathInputCheck {
|
||||||
* @see https://phabricator.wikimedia.org/T119300
|
* @see https://phabricator.wikimedia.org/T119300
|
||||||
* @param stdClass $e
|
* @param stdClass $e
|
||||||
* @param MathRenderer|null $errorRenderer
|
* @param MathRenderer|null $errorRenderer
|
||||||
* @return string
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function errorObjectToHtml( stdClass $e, $errorRenderer = null ) {
|
public function errorObjectToHtml( stdClass $e, $errorRenderer = null ) {
|
||||||
if ( $errorRenderer === null ) {
|
if ( $errorRenderer === null ) {
|
||||||
|
@ -77,7 +77,7 @@ class MathInputCheckRestbase extends MathInputCheck {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the string of the last error.
|
* Returns the string of the last error.
|
||||||
* @return string
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function getError() {
|
public function getError() {
|
||||||
$err = $this->restbaseInterface->getError();
|
$err = $this->restbaseInterface->getError();
|
||||||
|
|
|
@ -306,6 +306,7 @@ class MathMathML extends MathRenderer {
|
||||||
$this->lastError = '';
|
$this->lastError = '';
|
||||||
$requestResult = $this->makeRequest( $host, $post, $res, $this->lastError );
|
$requestResult = $this->makeRequest( $host, $post, $res, $this->lastError );
|
||||||
if ( $requestResult ) {
|
if ( $requestResult ) {
|
||||||
|
// @phan-suppress-next-line PhanTypeMismatchArgumentInternal
|
||||||
$jsonResult = json_decode( $res );
|
$jsonResult = json_decode( $res );
|
||||||
if ( $jsonResult && json_last_error() === JSON_ERROR_NONE ) {
|
if ( $jsonResult && json_last_error() === JSON_ERROR_NONE ) {
|
||||||
if ( $jsonResult->success ) {
|
if ( $jsonResult->success ) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class MathValidator implements ValueValidator {
|
||||||
// TeX string is not valid
|
// TeX string is not valid
|
||||||
return Result::newError(
|
return Result::newError(
|
||||||
[
|
[
|
||||||
Error::newError( null, null, 'malformed-value', [ $checker->getError() ] )
|
Error::newError( '', null, 'malformed-value', [ $checker->getError() ] )
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ class MathWikibaseConnector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $innerInfo ) {
|
if ( $innerInfo && $symbol ) {
|
||||||
$innerInfo->setSymbol( $symbol );
|
$innerInfo->setSymbol( $symbol );
|
||||||
$output->addHasPartElement( $innerInfo );
|
$output->addHasPartElement( $innerInfo );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue