diff --git a/tests/integration/includes/http/MWHttpRequestTestCase.php b/tests/integration/includes/http/MWHttpRequestTestCase.php index cbaa8f9b9bc..ec6dd45d36c 100644 --- a/tests/integration/includes/http/MWHttpRequestTestCase.php +++ b/tests/integration/includes/http/MWHttpRequestTestCase.php @@ -170,7 +170,7 @@ abstract class MWHttpRequestTestCase extends PHPUnit\Framework\TestCase { $request = $this->factory->create( 'http://httpbin.org/ip' ); $data = ''; - $request->setCallback( function ( $fh, $content ) use ( &$data ) { + $request->setCallback( static function ( $fh, $content ) use ( &$data ) { $data .= $content; return strlen( $content ); } ); diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 6d2856df492..5daf6c4b112 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -375,7 +375,7 @@ class ParserTestRunner { MediaWikiServices::getInstance()->disableService( 'MediaHandlerFactory' ); MediaWikiServices::getInstance()->redefineService( 'MediaHandlerFactory', - function ( MediaWikiServices $services ) { + static function ( MediaWikiServices $services ) { $handlers = $services->getMainConfig()->get( 'ParserTestMediaHandlers' ); return new MediaHandlerFactory( $handlers ); } @@ -877,7 +877,7 @@ class ParserTestRunner { $oldCallback = $options->getCurrentRevisionRecordCallback(); $options->setCurrentRevisionRecordCallback( - function ( Title $t, $parser = null ) use ( $title, $revRecord, $oldCallback ) { + static function ( Title $t, $parser = null ) use ( $title, $revRecord, $oldCallback ) { if ( $t->equals( $title ) ) { return $revRecord; } else { @@ -938,7 +938,7 @@ class ParserTestRunner { $teardownGuard = $this->perTestSetup( $test ); [ $title, $options, $revId ] = $this->setupParserOptions( (object)$test, - function ( $context, $title, $revId, $wikitext ) { + static function ( $context, $title, $revId, $wikitext ) { return ParserOptions::newFromContext( $context ); } ); @@ -949,12 +949,12 @@ class ParserTestRunner { if ( isset( $opts['styletag'] ) ) { // For testing the behavior of