Merge "build: Updating mediawiki/mediawiki-phan-config to 0.9.0"

This commit is contained in:
jenkins-bot 2020-01-11 00:39:01 +00:00 committed by Gerrit Code Review
commit 6f347e7b34
6 changed files with 7 additions and 5 deletions

View file

@ -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": [

View file

@ -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[] = [

View file

@ -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();

View file

@ -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 ) {

View file

@ -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() ] )
] ]
); );
} }

View file

@ -192,7 +192,7 @@ class MathWikibaseConnector {
} }
} }
if ( $innerInfo ) { if ( $innerInfo && $symbol ) {
$innerInfo->setSymbol( $symbol ); $innerInfo->setSymbol( $symbol );
$output->addHasPartElement( $innerInfo ); $output->addHasPartElement( $innerInfo );
} }