mediawiki/libs/Services: master (log #263684)

sourcepatches
From 73bfb29309b0645de154ffa0db21aa4ac8e83376 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Tue, 4 May 2021 11:32:19 +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: Icd0a5ece3d4d1c48b7f6c8d14a76566c2c7a9a88
---
 composer.json                  |  4 +-
 tests/ServiceContainerTest.php | 70 +++++++++++++++++-----------------
 tests/TestWiring1.php          |  2 +-
 tests/TestWiring2.php          |  2 +-
 tests/TestWiring3.php          |  2 +-
 5 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/composer.json b/composer.json
index 4c80f7b..bd348ea 100644
--- a/composer.json
+++ b/composer.json
@@ -23,11 +23,11 @@
 		"wikimedia/scoped-callback": "^3.0"
 	},
 	"require-dev": {
-		"mediawiki/mediawiki-codesniffer": "35.0.0",
+		"mediawiki/mediawiki-codesniffer": "36.0.0",
 		"mediawiki/minus-x": "1.1.1",
 		"ockcyp/covers-validator": "1.3.3",
 		"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",
 		"phpunit/phpunit": "^8.5"
 	},
 	"scripts": {
diff --git a/tests/ServiceContainerTest.php b/tests/ServiceContainerTest.php
index 360b0af..eff39b1 100644
--- a/tests/ServiceContainerTest.php
+++ b/tests/ServiceContainerTest.php
@@ -20,7 +20,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$this->assertEmpty( $names );
 
 		$name = 'TestService92834576';
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return null;
 		} );
 
@@ -34,7 +34,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$name = 'TestService92834576';
 		$this->assertFalse( $services->hasService( $name ) );
 
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return null;
 		} );
 
@@ -67,15 +67,15 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 	public function testGetServiceRecursionCheck() {
 		$services = $this->newServiceContainer();
 
-		$services->defineService( 'service1', function ( ServiceContainer $services ) {
+		$services->defineService( 'service1', static function ( ServiceContainer $services ) {
 			$services->getService( 'service2' );
 		} );
 
-		$services->defineService( 'service2', function ( ServiceContainer $services ) {
+		$services->defineService( 'service2', static function ( ServiceContainer $services ) {
 			$services->getService( 'service3' );
 		} );
 
-		$services->defineService( 'service3', function ( ServiceContainer $services ) {
+		$services->defineService( 'service3', static function ( ServiceContainer $services ) {
 			$services->getService( 'service1' );
 		} );
 
@@ -107,14 +107,14 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$services->defineService(
 			'Foo',
-			function () {
+			static function () {
 				return new stdClass();
 			}
 		);
 
 		$services->defineService(
 			'Bar',
-			function () {
+			static function () {
 				return new stdClass();
 			}
 		);
@@ -165,13 +165,13 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () use ( $theService ) {
+		$services->defineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 
 		$this->expectException( Wikimedia\Services\ServiceAlreadyDefinedException::class );
 
-		$services->defineService( $name, function () use ( $theService ) {
+		$services->defineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -180,10 +180,10 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$services = $this->newServiceContainer();
 
 		$wiring = [
-			'Foo' => function () {
+			'Foo' => static function () {
 				return 'Foo!';
 			},
-			'Bar' => function () {
+			'Bar' => static function () {
 				return 'Bar!';
 			},
 		];
@@ -198,7 +198,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$services = $this->newServiceContainer();
 
 		$wiring = [
-			'Foo' => function () {
+			'Foo' => static function () {
 				return 'Foo!';
 			},
 			'Bar' => 'not a function',
@@ -212,41 +212,41 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$services = $this->newServiceContainer();
 
 		$wiring = [
-			'Foo' => function () {
+			'Foo' => static function () {
 				return 'Foo!';
 			},
-			'Bar' => function () {
+			'Bar' => static function () {
 				return 'Bar!';
 			},
-			'Car' => function () {
+			'Car' => static function () {
 				return 'FUBAR!';
 			},
 		];
 
 		$services->applyWiring( $wiring );
 
-		$services->addServiceManipulator( 'Foo', function ( $service ) {
+		$services->addServiceManipulator( 'Foo', static function ( $service ) {
 			return $service . '+X';
 		} );
 
-		$services->addServiceManipulator( 'Car', function ( $service ) {
+		$services->addServiceManipulator( 'Car', static function ( $service ) {
 			return $service . '+X';
 		} );
 
 		$newServices = $this->newServiceContainer();
 
 		// create a service with manipulator
-		$newServices->defineService( 'Foo', function () {
+		$newServices->defineService( 'Foo', static function () {
 			return 'Foo!';
 		} );
 
-		$newServices->addServiceManipulator( 'Foo', function ( $service ) {
+		$newServices->addServiceManipulator( 'Foo', static function ( $service ) {
 			return $service . '+Y';
 		} );
 
 		// create a service before importing, so we can later check that
 		// existing service instances survive importWiring()
-		$newServices->defineService( 'Car', function () {
+		$newServices->defineService( 'Car', static function () {
 			return 'Car!';
 		} );
 
@@ -255,7 +255,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		// Define another service, so we can later check that extra wiring
 		// is not lost.
-		$newServices->defineService( 'Xar', function () {
+		$newServices->defineService( 'Xar', static function () {
 			return 'Xar!';
 		} );
 
@@ -346,14 +346,14 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService1 = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return 'Foo';
 		} );
 
 		// disable the service. we should be able to redefine it anyway.
 		$services->disableService( $name );
 
-		$services->redefineService( $name, function () use ( $theService1 ) {
+		$services->redefineService( $name, static function () use ( $theService1 ) {
 			return $theService1;
 		} );
 
@@ -369,7 +369,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\NoSuchServiceException::class );
 
-		$services->redefineService( $name, function () use ( $theService ) {
+		$services->redefineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -380,7 +380,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return 'Foo';
 		} );
 
@@ -389,7 +389,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\CannotReplaceActiveServiceException::class );
 
-		$services->redefineService( $name, function () use ( $theService ) {
+		$services->redefineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -436,7 +436,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\NoSuchServiceException::class );
 
-		$services->addServiceManipulator( $name, function () use ( $theService ) {
+		$services->addServiceManipulator( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -447,7 +447,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () use ( $theService ) {
+		$services->defineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 
@@ -456,7 +456,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\CannotReplaceActiveServiceException::class );
 
-		$services->addServiceManipulator( $name, function () {
+		$services->addServiceManipulator( $name, static function () {
 			return 'Foo';
 		} );
 	}
@@ -469,13 +469,13 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$destructible->expects( $this->once() )
 			->method( 'destroy' );
 
-		$services->defineService( 'Foo', function () use ( $destructible ) {
+		$services->defineService( 'Foo', static function () use ( $destructible ) {
 			return $destructible;
 		} );
-		$services->defineService( 'Bar', function () {
+		$services->defineService( 'Bar', static function () {
 			return new stdClass();
 		} );
-		$services->defineService( 'Qux', function () {
+		$services->defineService( 'Qux', static function () {
 			return new stdClass();
 		} );
 
@@ -515,7 +515,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\NoSuchServiceException::class );
 
-		$services->redefineService( $name, function () use ( $theService ) {
+		$services->redefineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -528,11 +528,11 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$destructible->expects( $this->once() )
 			->method( 'destroy' );
 
-		$services->defineService( 'Foo', function () use ( $destructible ) {
+		$services->defineService( 'Foo', static function () use ( $destructible ) {
 			return $destructible;
 		} );
 
-		$services->defineService( 'Bar', function () {
+		$services->defineService( 'Bar', static function () {
 			return new stdClass();
 		} );
 
diff --git a/tests/TestWiring1.php b/tests/TestWiring1.php
index b6ff4eb..e58d8c9 100644
--- a/tests/TestWiring1.php
+++ b/tests/TestWiring1.php
@@ -4,7 +4,7 @@
  */
 
 return [
-	'Foo' => function () {
+	'Foo' => static function () {
 		return 'Foo!';
 	},
 ];
diff --git a/tests/TestWiring2.php b/tests/TestWiring2.php
index dfff64f..2786909 100644
--- a/tests/TestWiring2.php
+++ b/tests/TestWiring2.php
@@ -4,7 +4,7 @@
  */
 
 return [
-	'Bar' => function () {
+	'Bar' => static function () {
 		return 'Bar!';
 	},
 ];
diff --git a/tests/TestWiring3.php b/tests/TestWiring3.php
index 601075d..710a39a 100644
--- a/tests/TestWiring3.php
+++ b/tests/TestWiring3.php
@@ -4,7 +4,7 @@
  */
 
 return (object)[
-	'Foo' => function () {
+	'Foo' => static function () {
 		return 'Foo!';
 	},
 ];
-- 
2.20.1

$ date
Tue May  4 11:32:06 UTC 2021

$ git clone file:///srv/git/mediawiki-libs-Services.git repo --depth=1 -b master
Cloning into 'repo'...

$ git config user.name libraryupgrader

$ git config user.email tools.libraryupgrader@tools.wmflabs.org

$ git submodule update --init

$ grr init
Installed commit-msg hook.

$ git show-ref refs/heads/master
1c3bd2c7c909a8b41f908cbadb4d75a5f2140759 refs/heads/master

$ composer install
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Package operations: 48 installs, 0 updates, 0 removals
  - Installing wikimedia/scoped-callback (v3.0.0): Loading from cache
  - Installing squizlabs/php_codesniffer (3.5.8): Loading from cache
  - Installing composer/spdx-licenses (1.5.5): Loading from cache
  - Installing composer/semver (3.2.4): Loading from cache
  - Installing mediawiki/mediawiki-codesniffer (v35.0.0): Loading from cache
  - Installing symfony/polyfill-php80 (v1.22.1): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.22.1): Loading from cache
  - Installing symfony/polyfill-intl-normalizer (v1.22.1): Loading from cache
  - Installing symfony/polyfill-intl-grapheme (v1.22.1): Loading from cache
  - Installing symfony/polyfill-ctype (v1.22.1): Loading from cache
  - Installing symfony/string (v5.2.6): Loading from cache
  - Installing psr/container (1.1.1): Loading from cache
  - Installing symfony/service-contracts (v2.4.0): Loading from cache
  - Installing symfony/polyfill-php73 (v1.22.1): Loading from cache
  - Installing symfony/console (v5.2.7): Loading from cache
  - Installing mediawiki/minus-x (1.1.1): Loading from cache
  - Installing sebastian/version (2.0.1): Loading from cache
  - Installing sebastian/type (1.1.4): Loading from cache
  - Installing sebastian/resource-operations (2.0.2): Loading from cache
  - Installing sebastian/recursion-context (3.0.1): Loading from cache
  - Installing sebastian/object-reflector (1.1.2): Loading from cache
  - Installing sebastian/object-enumerator (3.0.4): Loading from cache
  - Installing sebastian/global-state (3.0.1): Loading from cache
  - Installing sebastian/exporter (3.1.3): Loading from cache
  - Installing sebastian/environment (4.2.4): Loading from cache
  - Installing sebastian/diff (3.0.3): Loading from cache
  - Installing sebastian/comparator (3.0.3): Loading from cache
  - Installing phpunit/php-timer (2.1.3): Loading from cache
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
  - Installing phpunit/php-file-iterator (2.0.3): Loading from cache
  - Installing theseer/tokenizer (1.2.0): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (1.0.2): Loading from cache
  - Installing phpunit/php-token-stream (4.0.4): Loading from cache
  - Installing phpunit/php-code-coverage (7.0.14): Loading from cache
  - Installing doctrine/instantiator (1.4.0): Loading from cache
  - Installing phpdocumentor/reflection-common (2.2.0): Loading from cache
  - Installing webmozart/assert (1.10.0): Loading from cache
  - Installing phpdocumentor/type-resolver (1.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (5.2.2): Loading from cache
  - Installing phpspec/prophecy (1.13.0): Loading from cache
  - Installing myclabs/deep-copy (1.10.2): Loading from cache
  - Installing phar-io/version (3.1.0): Loading from cache
  - Installing phar-io/manifest (2.0.1): Loading from cache
  - Installing phpunit/phpunit (8.5.15): Loading from cache
  - Installing ockcyp/covers-validator (v1.3.3): Loading from cache
  - Installing php-parallel-lint/php-console-color (v0.3): Loading from cache
  - Installing php-parallel-lint/php-console-highlighter (v0.5): Loading from cache
  - Installing php-parallel-lint/php-parallel-lint (v1.2.0): Loading from cache
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/event-dispatcher
symfony/console suggests installing symfony/lock
symfony/console suggests installing symfony/process
symfony/console suggests installing psr/log (For using the console logger)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.7.2)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0.0)
phpunit/phpunit suggests installing ext-soap (*)
phpunit/phpunit suggests installing ext-xdebug (*)
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
30 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Upgrading c:mediawiki/mediawiki-codesniffer from 35.0.0 -> 36.0.0
Upgrading c:php-parallel-lint/php-parallel-lint from 1.2.0 -> 1.3.0
$ composer update
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
  - Updating squizlabs/php_codesniffer (3.5.8 => 3.6.0): Loading from cache
  - Updating mediawiki/mediawiki-codesniffer (v35.0.0 => v36.0.0): Loading from cache
  - Updating php-parallel-lint/php-parallel-lint (v1.2.0 => v1.3.0): Loading from cache
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
30 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

{'MediaWiki.Commenting.PropertyDocumentation.ObjectTypeHintVar', 'MediaWiki.Commenting.FunctionComment.ObjectTypeHintReturn'}
Tests fail!
$ vendor/bin/phpcbf

PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE                                                  FIXED  REMAINING
----------------------------------------------------------------------
/src/repo/tests/ServiceContainerTest.php              35     0
/src/repo/tests/TestWiring2.php                       1      0
/src/repo/tests/TestWiring1.php                       1      0
/src/repo/tests/TestWiring3.php                       1      0
----------------------------------------------------------------------
A TOTAL OF 38 ERRORS WERE FIXED IN 4 FILES
----------------------------------------------------------------------

Time: 319ms; Memory: 14MB



$ git checkout .phpcs.xml

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
30 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

$ composer test
> parallel-lint . --exclude vendor
PHP 7.3.27 | 10 parallel jobs
.............                                                13/13 (100 %)


Checked 13 files in 0.1 seconds
No syntax error found
> phpunit
PHPUnit 8.5.15 by Sebastian Bergmann and contributors.

.........................                                         25 / 25 (100%)

Time: 49 ms, Memory: 4.00 MB

OK (25 tests, 57 assertions)
> covers-validator
CoversValidator 1.3.3

Validation complete. All @covers tags are valid.
> phpcs -sp
............. 13 / 13 (100%)


Time: 182ms; Memory: 12MB

> minus-x check .
MinusX
======
Processing /src/repo...
...........................
All good!

$ git add .

$ git commit -F /tmp/tmprk7mbm3e
[master 73bfb29] build: Updating composer dependencies
 5 files changed, 40 insertions(+), 40 deletions(-)

$ git format-patch HEAD~1 --stdout
From 73bfb29309b0645de154ffa0db21aa4ac8e83376 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Tue, 4 May 2021 11:32:19 +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: Icd0a5ece3d4d1c48b7f6c8d14a76566c2c7a9a88
---
 composer.json                  |  4 +-
 tests/ServiceContainerTest.php | 70 +++++++++++++++++-----------------
 tests/TestWiring1.php          |  2 +-
 tests/TestWiring2.php          |  2 +-
 tests/TestWiring3.php          |  2 +-
 5 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/composer.json b/composer.json
index 4c80f7b..bd348ea 100644
--- a/composer.json
+++ b/composer.json
@@ -23,11 +23,11 @@
 		"wikimedia/scoped-callback": "^3.0"
 	},
 	"require-dev": {
-		"mediawiki/mediawiki-codesniffer": "35.0.0",
+		"mediawiki/mediawiki-codesniffer": "36.0.0",
 		"mediawiki/minus-x": "1.1.1",
 		"ockcyp/covers-validator": "1.3.3",
 		"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",
 		"phpunit/phpunit": "^8.5"
 	},
 	"scripts": {
diff --git a/tests/ServiceContainerTest.php b/tests/ServiceContainerTest.php
index 360b0af..eff39b1 100644
--- a/tests/ServiceContainerTest.php
+++ b/tests/ServiceContainerTest.php
@@ -20,7 +20,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$this->assertEmpty( $names );
 
 		$name = 'TestService92834576';
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return null;
 		} );
 
@@ -34,7 +34,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$name = 'TestService92834576';
 		$this->assertFalse( $services->hasService( $name ) );
 
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return null;
 		} );
 
@@ -67,15 +67,15 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 	public function testGetServiceRecursionCheck() {
 		$services = $this->newServiceContainer();
 
-		$services->defineService( 'service1', function ( ServiceContainer $services ) {
+		$services->defineService( 'service1', static function ( ServiceContainer $services ) {
 			$services->getService( 'service2' );
 		} );
 
-		$services->defineService( 'service2', function ( ServiceContainer $services ) {
+		$services->defineService( 'service2', static function ( ServiceContainer $services ) {
 			$services->getService( 'service3' );
 		} );
 
-		$services->defineService( 'service3', function ( ServiceContainer $services ) {
+		$services->defineService( 'service3', static function ( ServiceContainer $services ) {
 			$services->getService( 'service1' );
 		} );
 
@@ -107,14 +107,14 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$services->defineService(
 			'Foo',
-			function () {
+			static function () {
 				return new stdClass();
 			}
 		);
 
 		$services->defineService(
 			'Bar',
-			function () {
+			static function () {
 				return new stdClass();
 			}
 		);
@@ -165,13 +165,13 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () use ( $theService ) {
+		$services->defineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 
 		$this->expectException( Wikimedia\Services\ServiceAlreadyDefinedException::class );
 
-		$services->defineService( $name, function () use ( $theService ) {
+		$services->defineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -180,10 +180,10 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$services = $this->newServiceContainer();
 
 		$wiring = [
-			'Foo' => function () {
+			'Foo' => static function () {
 				return 'Foo!';
 			},
-			'Bar' => function () {
+			'Bar' => static function () {
 				return 'Bar!';
 			},
 		];
@@ -198,7 +198,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$services = $this->newServiceContainer();
 
 		$wiring = [
-			'Foo' => function () {
+			'Foo' => static function () {
 				return 'Foo!';
 			},
 			'Bar' => 'not a function',
@@ -212,41 +212,41 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$services = $this->newServiceContainer();
 
 		$wiring = [
-			'Foo' => function () {
+			'Foo' => static function () {
 				return 'Foo!';
 			},
-			'Bar' => function () {
+			'Bar' => static function () {
 				return 'Bar!';
 			},
-			'Car' => function () {
+			'Car' => static function () {
 				return 'FUBAR!';
 			},
 		];
 
 		$services->applyWiring( $wiring );
 
-		$services->addServiceManipulator( 'Foo', function ( $service ) {
+		$services->addServiceManipulator( 'Foo', static function ( $service ) {
 			return $service . '+X';
 		} );
 
-		$services->addServiceManipulator( 'Car', function ( $service ) {
+		$services->addServiceManipulator( 'Car', static function ( $service ) {
 			return $service . '+X';
 		} );
 
 		$newServices = $this->newServiceContainer();
 
 		// create a service with manipulator
-		$newServices->defineService( 'Foo', function () {
+		$newServices->defineService( 'Foo', static function () {
 			return 'Foo!';
 		} );
 
-		$newServices->addServiceManipulator( 'Foo', function ( $service ) {
+		$newServices->addServiceManipulator( 'Foo', static function ( $service ) {
 			return $service . '+Y';
 		} );
 
 		// create a service before importing, so we can later check that
 		// existing service instances survive importWiring()
-		$newServices->defineService( 'Car', function () {
+		$newServices->defineService( 'Car', static function () {
 			return 'Car!';
 		} );
 
@@ -255,7 +255,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		// Define another service, so we can later check that extra wiring
 		// is not lost.
-		$newServices->defineService( 'Xar', function () {
+		$newServices->defineService( 'Xar', static function () {
 			return 'Xar!';
 		} );
 
@@ -346,14 +346,14 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService1 = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return 'Foo';
 		} );
 
 		// disable the service. we should be able to redefine it anyway.
 		$services->disableService( $name );
 
-		$services->redefineService( $name, function () use ( $theService1 ) {
+		$services->redefineService( $name, static function () use ( $theService1 ) {
 			return $theService1;
 		} );
 
@@ -369,7 +369,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\NoSuchServiceException::class );
 
-		$services->redefineService( $name, function () use ( $theService ) {
+		$services->redefineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -380,7 +380,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () {
+		$services->defineService( $name, static function () {
 			return 'Foo';
 		} );
 
@@ -389,7 +389,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\CannotReplaceActiveServiceException::class );
 
-		$services->redefineService( $name, function () use ( $theService ) {
+		$services->redefineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -436,7 +436,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\NoSuchServiceException::class );
 
-		$services->addServiceManipulator( $name, function () use ( $theService ) {
+		$services->addServiceManipulator( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -447,7 +447,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$theService = new stdClass();
 		$name = 'TestService92834576';
 
-		$services->defineService( $name, function () use ( $theService ) {
+		$services->defineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 
@@ -456,7 +456,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\CannotReplaceActiveServiceException::class );
 
-		$services->addServiceManipulator( $name, function () {
+		$services->addServiceManipulator( $name, static function () {
 			return 'Foo';
 		} );
 	}
@@ -469,13 +469,13 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$destructible->expects( $this->once() )
 			->method( 'destroy' );
 
-		$services->defineService( 'Foo', function () use ( $destructible ) {
+		$services->defineService( 'Foo', static function () use ( $destructible ) {
 			return $destructible;
 		} );
-		$services->defineService( 'Bar', function () {
+		$services->defineService( 'Bar', static function () {
 			return new stdClass();
 		} );
-		$services->defineService( 'Qux', function () {
+		$services->defineService( 'Qux', static function () {
 			return new stdClass();
 		} );
 
@@ -515,7 +515,7 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 
 		$this->expectException( Wikimedia\Services\NoSuchServiceException::class );
 
-		$services->redefineService( $name, function () use ( $theService ) {
+		$services->redefineService( $name, static function () use ( $theService ) {
 			return $theService;
 		} );
 	}
@@ -528,11 +528,11 @@ class ServiceContainerTest extends PHPUnit\Framework\TestCase {
 		$destructible->expects( $this->once() )
 			->method( 'destroy' );
 
-		$services->defineService( 'Foo', function () use ( $destructible ) {
+		$services->defineService( 'Foo', static function () use ( $destructible ) {
 			return $destructible;
 		} );
 
-		$services->defineService( 'Bar', function () {
+		$services->defineService( 'Bar', static function () {
 			return new stdClass();
 		} );
 
diff --git a/tests/TestWiring1.php b/tests/TestWiring1.php
index b6ff4eb..e58d8c9 100644
--- a/tests/TestWiring1.php
+++ b/tests/TestWiring1.php
@@ -4,7 +4,7 @@
  */
 
 return [
-	'Foo' => function () {
+	'Foo' => static function () {
 		return 'Foo!';
 	},
 ];
diff --git a/tests/TestWiring2.php b/tests/TestWiring2.php
index dfff64f..2786909 100644
--- a/tests/TestWiring2.php
+++ b/tests/TestWiring2.php
@@ -4,7 +4,7 @@
  */
 
 return [
-	'Bar' => function () {
+	'Bar' => static function () {
 		return 'Bar!';
 	},
 ];
diff --git a/tests/TestWiring3.php b/tests/TestWiring3.php
index 601075d..710a39a 100644
--- a/tests/TestWiring3.php
+++ b/tests/TestWiring3.php
@@ -4,7 +4,7 @@
  */
 
 return (object)[
-	'Foo' => function () {
+	'Foo' => static function () {
 		return 'Foo!';
 	},
 ];
-- 
2.20.1

Source code is licensed under the AGPL.