🚧 This instance is under construction; expect occasional downtime. Runners available in /repos. Questions? Ask in #wikimedia-gitlab on libera.chat, or under GitLab on Phabricator.

Commit 49885d92 authored by Samwilson's avatar Samwilson
Browse files

Update dependencies and fix MW 1.36 compatibility

parent 49566306
......@@ -8,6 +8,7 @@ use LocalRepo;
use MediaWiki\MediaWikiServices;
use MediaWiki\Shell\Result;
use MediaWiki\Shell\Shell;
use Shellbox\Command\UnboxedResult;
class Diagrams {
......@@ -111,9 +112,9 @@ class Diagrams {
* @param string $outputFormat
* @param string $inputFilename
* @param string $outputFilename
* @return Result
* @return Result|UnboxedResult
*/
private function runCommand( $commandName, $outputFormat, $inputFilename, $outputFilename ): Result {
private function runCommand( $commandName, $outputFormat, $inputFilename, $outputFilename ) {
if ( $commandName === 'plantuml' ) {
$cmdArgs = [ "-t$outputFormat", '-output', dirname( $outputFilename ), '-syntax' ];
} else {
......
......@@ -17,7 +17,7 @@ class Hooks {
$isPreview = $parserOptions ? $parserOptions->getIsPreview() : false;
$diagrams = new Diagrams( $isPreview );
foreach ( [ 'graphviz', 'mscgen', 'uml' ] as $tag ) {
$parser->setHook( $tag, function (
$parser->setHook( $tag, static function (
string $input, array $params, Parser $parser, PPFrame $frame
) use (
$tag, $diagrams
......
......@@ -102,7 +102,7 @@ class ImageMap {
$xpath = new DOMXPath( $dom );
$hrefNodes = $xpath->query( '//*[@href]' );
foreach ( $hrefNodes as $hrefNode ) {
$newHref = preg_replace_callback( '/(\[\[?)([^\]\|]+)\|?([^\]])*\]?\]/', function ( $matches ) {
$newHref = preg_replace_callback( '/(\[\[?)([^\]\|]+)\|?([^\]])*\]?\]/', static function ( $matches ) {
if ( $matches[1] === '[[' ) {
// Internal link.
$title = Title::newFromText( $matches[2] );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment