From c3c98c114665a0bcf1bdc1d87c4c272c96a38c6a Mon Sep 17 00:00:00 2001 From: libraryupgrader Date: Tue, 4 May 2021 07:24:31 +0000 Subject: [PATCH] build: Updating composer dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0 * php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0 Change-Id: I5e0b9e78f0436355cc21dc356fb78e96e59cb536 --- composer.json | 4 ++-- includes/Gadget.php | 2 +- includes/GadgetDefinitionNamespaceRepo.php | 2 +- includes/MediaWikiGadgetsDefinitionRepo.php | 2 +- tests/phpunit/unit/GadgetTest.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index c6777f21..044edbb3 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,10 @@ { "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", + "mediawiki/mediawiki-codesniffer": "36.0.0", "mediawiki/mediawiki-phan-config": "0.10.6", "mediawiki/minus-x": "1.1.1", "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0" + "php-parallel-lint/php-parallel-lint": "1.3.0" }, "scripts": { "fix": [ diff --git a/includes/Gadget.php b/includes/Gadget.php index 52f39f6f..938d4a01 100644 --- a/includes/Gadget.php +++ b/includes/Gadget.php @@ -88,7 +88,7 @@ class Gadget { */ public static function newFromDefinitionContent( $id, GadgetDefinitionContent $content ) { $data = $content->getAssocArray(); - $prefixGadgetNs = function ( $page ) { + $prefixGadgetNs = static function ( $page ) { return 'Gadget:' . $page; }; $info = [ diff --git a/includes/GadgetDefinitionNamespaceRepo.php b/includes/GadgetDefinitionNamespaceRepo.php index f83687f3..639d3266 100644 --- a/includes/GadgetDefinitionNamespaceRepo.php +++ b/includes/GadgetDefinitionNamespaceRepo.php @@ -46,7 +46,7 @@ class GadgetDefinitionNamespaceRepo extends GadgetRepo { return $this->wanCache->getWithSetCallback( $key, self::CACHE_TTL, - function ( $oldValue, &$ttl, array &$setOpts ) use ( $fname ) { + static function ( $oldValue, &$ttl, array &$setOpts ) use ( $fname ) { $dbr = wfGetDB( DB_REPLICA ); $setOpts += Database::getCacheSetOptions( $dbr ); diff --git a/includes/MediaWikiGadgetsDefinitionRepo.php b/includes/MediaWikiGadgetsDefinitionRepo.php index 71e0cf5f..69557737 100644 --- a/includes/MediaWikiGadgetsDefinitionRepo.php +++ b/includes/MediaWikiGadgetsDefinitionRepo.php @@ -106,7 +106,7 @@ class MediaWikiGadgetsDefinitionRepo extends GadgetRepo { $value = $wanCache->getWithSetCallback( $key, Gadget::CACHE_TTL, - function ( $old, &$ttl, &$setOpts ) use ( $us ) { + static function ( $old, &$ttl, &$setOpts ) use ( $us ) { $setOpts += Database::getCacheSetOptions( wfGetDB( DB_REPLICA ) ); $now = microtime( true ); diff --git a/tests/phpunit/unit/GadgetTest.php b/tests/phpunit/unit/GadgetTest.php index 1a37a8c7..08976642 100644 --- a/tests/phpunit/unit/GadgetTest.php +++ b/tests/phpunit/unit/GadgetTest.php @@ -69,11 +69,11 @@ class GadgetTest extends MediaWikiUnitTestCase { */ public function testIsAllowed() { $user = $this->getMockBuilder( User::class ) - ->setMethods( [ 'isAllowedAll' ] ) + ->onlyMethods( [ 'isAllowedAll' ] ) ->getMock(); $user->method( 'isAllowedAll' ) ->willReturnCallback( - function ( ...$rights ) { + static function ( ...$rights ) { return array_diff( $rights, [ 'test' ] ) === []; } );