mediawiki/libs/WaitConditionLoop: master (log #263687)

sourcepatches
From 0d5264442af88836fd68fd735c618ed237d05675 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Tue, 4 May 2021 11:34:47 +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: I85a28eb60d914a1eaddd97c2f3ffb7772ed17aaa
---
 composer.json                   |  4 ++--
 src/WaitConditionLoop.php       |  2 +-
 tests/WaitConditionLoopTest.php | 24 ++++++++++++------------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/composer.json b/composer.json
index 50d702a..74868d1 100644
--- a/composer.json
+++ b/composer.json
@@ -23,11 +23,11 @@
 		"php": ">=7.2.9"
 	},
 	"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/src/WaitConditionLoop.php b/src/WaitConditionLoop.php
index 2b5ea8b..2544d04 100644
--- a/src/WaitConditionLoop.php
+++ b/src/WaitConditionLoop.php
@@ -185,7 +185,7 @@ class WaitConditionLoop {
 			try {
 				$workCallback();
 			} catch ( \Exception $e ) {
-				$workCallback = function () use ( $e ) {
+				$workCallback = static function () use ( $e ) {
 					throw $e;
 				};
 			}
diff --git a/tests/WaitConditionLoopTest.php b/tests/WaitConditionLoopTest.php
index d42ff87..ee4ec11 100644
--- a/tests/WaitConditionLoopTest.php
+++ b/tests/WaitConditionLoopTest.php
@@ -35,7 +35,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$count = 0;
 		$status = new \stdClass();
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, $status ) {
+			static function () use ( &$count, $status ) {
 				++$count;
 				$status->value = 'cookie';
 
@@ -51,7 +51,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 1;
 				++$count;
 
@@ -66,7 +66,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 0.1;
 				++$count;
 
@@ -94,7 +94,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$count = 0;
 		$wallClock = microtime( true );
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 3;
 				++$count;
 
@@ -108,7 +108,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$this->assertEquals( [ 1, 1, 1 ], [ $x, $y, $z ], "Busy work done" );
 
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 3;
 				++$count;
 
@@ -121,7 +121,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 3;
 				++$count;
 
@@ -137,7 +137,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$x = 0;
 		$wallClock = microtime( true );
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$x, &$wallClock ) {
+			static function () use ( &$x, &$wallClock ) {
 				$wallClock += 2;
 				++$x;
 
@@ -155,7 +155,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$wallClock = microtime( true );
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 1.0;
 				$count++;
 				return ( $count > 2 );
@@ -175,22 +175,22 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$badCalls = 0;
 
 		$list = [];
-		$list[] = function () use ( &$x, &$wallClock ) {
+		$list[] = static function () use ( &$x, &$wallClock ) {
 			$wallClock += 1;
 
 			return ++$x;
 		};
-		$dontCallMe = function () use ( &$badCalls ) {
+		$dontCallMe = static function () use ( &$badCalls ) {
 			++$badCalls;
 			throw new \RuntimeException( "TrollyMcTrollFace" );
 		};
 		$list[] =& $dontCallMe;
-		$list[] = function () use ( &$y, &$wallClock ) {
+		$list[] = static function () use ( &$y, &$wallClock ) {
 			$wallClock += 15;
 
 			return ++$y;
 		};
-		$list[] = function () use ( &$z, &$wallClock ) {
+		$list[] = static function () use ( &$z, &$wallClock ) {
 			$wallClock += 0.1;
 
 			return ++$z;
-- 
2.20.1

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

$ git clone file:///srv/git/mediawiki-libs-WaitConditionLoop.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
44637dcee19765c4887cd3cc0fd97db0eabd7688 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: 47 installs, 0 updates, 0 removals
  - 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!

set()
Tests fail!
$ vendor/bin/phpcbf

PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE                                                  FIXED  REMAINING
----------------------------------------------------------------------
/src/repo/tests/WaitConditionLoopTest.php             12     0
/src/repo/src/WaitConditionLoop.php                   1      0
----------------------------------------------------------------------
A TOTAL OF 13 ERRORS WERE FIXED IN 2 FILES
----------------------------------------------------------------------

Time: 212ms; Memory: 10MB



$ 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
...                                                          3/3 (100 %)


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

....                                                                4 / 4 (100%)

Time: 27 ms, Memory: 4.00 MB

OK (4 tests, 19 assertions)
> covers-validator
CoversValidator 1.3.3

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


Time: 135ms; Memory: 10MB

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

$ git add .

$ git commit -F /tmp/tmpre_9f8w4
[master 0d52644] build: Updating composer dependencies
 3 files changed, 15 insertions(+), 15 deletions(-)

$ git format-patch HEAD~1 --stdout
From 0d5264442af88836fd68fd735c618ed237d05675 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Tue, 4 May 2021 11:34:47 +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: I85a28eb60d914a1eaddd97c2f3ffb7772ed17aaa
---
 composer.json                   |  4 ++--
 src/WaitConditionLoop.php       |  2 +-
 tests/WaitConditionLoopTest.php | 24 ++++++++++++------------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/composer.json b/composer.json
index 50d702a..74868d1 100644
--- a/composer.json
+++ b/composer.json
@@ -23,11 +23,11 @@
 		"php": ">=7.2.9"
 	},
 	"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/src/WaitConditionLoop.php b/src/WaitConditionLoop.php
index 2b5ea8b..2544d04 100644
--- a/src/WaitConditionLoop.php
+++ b/src/WaitConditionLoop.php
@@ -185,7 +185,7 @@ class WaitConditionLoop {
 			try {
 				$workCallback();
 			} catch ( \Exception $e ) {
-				$workCallback = function () use ( $e ) {
+				$workCallback = static function () use ( $e ) {
 					throw $e;
 				};
 			}
diff --git a/tests/WaitConditionLoopTest.php b/tests/WaitConditionLoopTest.php
index d42ff87..ee4ec11 100644
--- a/tests/WaitConditionLoopTest.php
+++ b/tests/WaitConditionLoopTest.php
@@ -35,7 +35,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$count = 0;
 		$status = new \stdClass();
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, $status ) {
+			static function () use ( &$count, $status ) {
 				++$count;
 				$status->value = 'cookie';
 
@@ -51,7 +51,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 1;
 				++$count;
 
@@ -66,7 +66,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 0.1;
 				++$count;
 
@@ -94,7 +94,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$count = 0;
 		$wallClock = microtime( true );
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 3;
 				++$count;
 
@@ -108,7 +108,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$this->assertEquals( [ 1, 1, 1 ], [ $x, $y, $z ], "Busy work done" );
 
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 3;
 				++$count;
 
@@ -121,7 +121,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 3;
 				++$count;
 
@@ -137,7 +137,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$x = 0;
 		$wallClock = microtime( true );
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$x, &$wallClock ) {
+			static function () use ( &$x, &$wallClock ) {
 				$wallClock += 2;
 				++$x;
 
@@ -155,7 +155,7 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$wallClock = microtime( true );
 		$count = 0;
 		$loop = new WaitConditionLoopFakeTime(
-			function () use ( &$count, &$wallClock ) {
+			static function () use ( &$count, &$wallClock ) {
 				$wallClock += 1.0;
 				$count++;
 				return ( $count > 2 );
@@ -175,22 +175,22 @@ class WaitConditionLoopTest extends \PHPUnit\Framework\TestCase {
 		$badCalls = 0;
 
 		$list = [];
-		$list[] = function () use ( &$x, &$wallClock ) {
+		$list[] = static function () use ( &$x, &$wallClock ) {
 			$wallClock += 1;
 
 			return ++$x;
 		};
-		$dontCallMe = function () use ( &$badCalls ) {
+		$dontCallMe = static function () use ( &$badCalls ) {
 			++$badCalls;
 			throw new \RuntimeException( "TrollyMcTrollFace" );
 		};
 		$list[] =& $dontCallMe;
-		$list[] = function () use ( &$y, &$wallClock ) {
+		$list[] = static function () use ( &$y, &$wallClock ) {
 			$wallClock += 15;
 
 			return ++$y;
 		};
-		$list[] = function () use ( &$z, &$wallClock ) {
+		$list[] = static function () use ( &$z, &$wallClock ) {
 			$wallClock += 0.1;
 
 			return ++$z;
-- 
2.20.1

Source code is licensed under the AGPL.