mediawiki/libs/Zest (master)

sourcepatches
From 21cfac8bee9fd0c3d3175d1a8beed211daff7c8a Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Wed, 5 May 2021 11:11:53 +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
  The following sniffs now pass and were enabled:
  * MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: Ic1aeb29eb0e27dc0f1f78d41c5ec179bbbb22c05
---
 .phpcs.xml             |   1 -
 composer.json          |   4 +-
 src/ZestInst.php       | 104 ++++++++++++++++++++---------------------
 tests/ZestInstTest.php |   2 +-
 4 files changed, 55 insertions(+), 56 deletions(-)

diff --git a/.phpcs.xml b/.phpcs.xml
index 1ad439a..a2bd8af 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -8,7 +8,6 @@
 		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
-		<exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
 		<exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
diff --git a/composer.json b/composer.json
index 9debae9..d8b648b 100644
--- a/composer.json
+++ b/composer.json
@@ -26,12 +26,12 @@
 		"ext-intl": "*"
 	},
 	"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",
 		"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 || ^9.5",
 		"wikimedia/remex-html": "^2.2.2 || ^2.3",
 		"wikimedia/testing-access-wrapper": "~1.0"
diff --git a/src/ZestInst.php b/src/ZestInst.php
index ef40df1..f49a2fe 100644
--- a/src/ZestInst.php
+++ b/src/ZestInst.php
@@ -194,7 +194,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	private static function xpathQuote( string $s ): string {
 		// Ugly-but-functional escape mechanism for xpath query
 		$parts = explode( "'", $s );
-		$parts = array_map( function ( string $ss ) {
+		$parts = array_map( static function ( string $ss ) {
 			return "'$ss'";
 		}, $parts );
 		if ( count( $parts ) === 1 ) {
@@ -412,12 +412,12 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	}
 
 	private function initSelectors() {
-		$this->addSelector0( '*', function ( $el ): bool {
+		$this->addSelector0( '*', static function ( $el ): bool {
 			return true;
 		} );
-		$this->addSelector1( 'type', function ( string $type ): callable {
+		$this->addSelector1( 'type', static function ( string $type ): callable {
 			$type = strtolower( $type );
-			return function ( $el ) use ( $type ): bool {
+			return static function ( $el ) use ( $type ): bool {
 				return strtolower( $el->nodeName ) === $type;
 			};
 		} );
@@ -432,7 +432,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				&& self::parentIsElement( $el );
 		} );
 		$this->addSelector1( ':nth-child', function ( string $param, bool $last = false ): callable {
-			return self::nth( $param, function ( $ignore1, $ignore2 ) {
+			return self::nth( $param, static function ( $ignore1, $ignore2 ) {
 				return true;
 			}, $last );
 		} );
@@ -440,15 +440,15 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector1( ':nth-last-child', function ( string $param ): callable {
 			return $this->selectors1[ ':nth-child' ]( $param, true );
 		} );
-		$this->addSelector0( ':root', function ( $el ): bool {
+		$this->addSelector0( ':root', static function ( $el ): bool {
 			return $el->ownerDocument->documentElement === $el;
 		} );
-		$this->addSelector0( ':empty', function ( $el ): bool {
+		$this->addSelector0( ':empty', static function ( $el ): bool {
 			return !$el->firstChild;
 		} );
 		$this->addSelector1( ':not', function ( string $sel ) {
 			$test = self::compileGroup( $sel );
-			return function ( $el ) use ( $test ): bool {
+			return static function ( $el ) use ( $test ): bool {
 				return !call_user_func( $test, $el );
 			};
 		} );
@@ -481,7 +481,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				$this->selectors0[ ':last-of-type' ]( $el );
 		} );
 		$this->addSelector1( ':nth-of-type', function ( string $param, bool $last = false ): callable  {
-			return self::nth( $param, function ( $rel, $el ) {
+			return self::nth( $param, static function ( $rel, $el ) {
 				return $rel->nodeName === $el->nodeName;
 			}, $last );
 		} );
@@ -489,7 +489,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector1( ':nth-last-of-type', function ( string $param ): callable {
 			return $this->selectors1[ ':nth-of-type' ]( $param, true );
 		} );
-		$this->addSelector0( ':checked', function ( $el ): bool {
+		$this->addSelector0( ':checked', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			// XXX these properties don't exist in the PHP DOM
 			// return $el->checked || $el->selected;
@@ -498,13 +498,13 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector0( ':indeterminate', function ( $el ): bool {
 			return !$this->selectors0[ ':checked' ]( $el );
 		} );
-		$this->addSelector0( ':enabled', function ( $el ): bool {
+		$this->addSelector0( ':enabled', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			// XXX these properties don't exist in the PHP DOM
 			// return !$el->disabled && $el->type !== 'hidden';
 			return !$el->hasAttribute( 'disabled' ) && $el->getAttribute( 'type' ) !== 'hidden';
 		} );
-		$this->addSelector0( ':disabled', function ( $el ): bool {
+		$this->addSelector0( ':disabled', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			// XXX these properties don't exist in the PHP DOM
 			// return !!$el->disabled;
@@ -542,8 +542,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return $el . '' === $window->location . '';
 		});
 		*/
-		$this->addSelector1( ':lang', function ( string $param ): callable {
-			return function ( $el ) use ( $param ): bool {
+		$this->addSelector1( ':lang', static function ( string $param ): callable {
+			return static function ( $el ) use ( $param ): bool {
 				'@phan-var DOMElement $el';
 				while ( $el ) {
 					// PHP DOM doesn't have 'lang' property
@@ -556,8 +556,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				return false;
 			};
 		} );
-		$this->addSelector1( ':dir', function ( string $param ): callable {
-			return function ( $el ) use ( $param ): bool {
+		$this->addSelector1( ':dir', static function ( string $param ): callable {
+			return static function ( $el ) use ( $param ): bool {
 				'@phan-var DOMElement $el';
 				while ( $el ) {
 					$dir = $el->getAttribute( 'dir' );
@@ -613,14 +613,14 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector0( ':out-of-range', function ( $el ): bool {
 			return !$this->selectors0[ ':in-range' ]( $el );
 		} );
-		$this->addSelector0( ':required', function ( $el ): bool {
+		$this->addSelector0( ':required', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			return $el->hasAttribute( 'required' );
 		} );
 		$this->addSelector0( ':optional', function ( $el ): bool {
 			return !$this->selectors0[ ':required' ]( $el );
 		} );
-		$this->addSelector0( ':read-only', function ( $el ): bool {
+		$this->addSelector0( ':read-only', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			if ( $el->hasAttribute( 'readOnly' ) ) {
 				return true;
@@ -636,39 +636,39 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector0( ':read-write', function ( $el ): bool {
 			return !$this->selectors0[ ':read-only' ]( $el );
 		} );
-		$this->addSelector0( ':hover', function ( $el ): bool {
+		$this->addSelector0( ':hover', static function ( $el ): bool {
 			throw new Error( ':hover is not supported.' );
 		} );
-		$this->addSelector0( ':active', function ( $el ): bool {
+		$this->addSelector0( ':active', static function ( $el ): bool {
 			throw new Error( ':active is not supported.' );
 		} );
-		$this->addSelector0( ':link', function ( $el ): bool {
+		$this->addSelector0( ':link', static function ( $el ): bool {
 			throw new Error( ':link is not supported.' );
 		} );
-		$this->addSelector0( ':visited', function ( $el ): bool {
+		$this->addSelector0( ':visited', static function ( $el ): bool {
 			throw new Error( ':visited is not supported.' );
 		} );
-		$this->addSelector0( ':column', function ( $el ): bool {
+		$this->addSelector0( ':column', static function ( $el ): bool {
 			throw new Error( ':column is not supported.' );
 		} );
-		$this->addSelector0( ':nth-column', function ( $el ): bool {
+		$this->addSelector0( ':nth-column', static function ( $el ): bool {
 			throw new Error( ':nth-column is not supported.' );
 		} );
-		$this->addSelector0( ':nth-last-column', function ( $el ): bool {
+		$this->addSelector0( ':nth-last-column', static function ( $el ): bool {
 			throw new Error( ':nth-last-column is not supported.' );
 		} );
-		$this->addSelector0( ':current', function ( $el ): bool {
+		$this->addSelector0( ':current', static function ( $el ): bool {
 			throw new Error( ':current is not supported.' );
 		} );
-		$this->addSelector0( ':past', function ( $el ): bool {
+		$this->addSelector0( ':past', static function ( $el ): bool {
 			throw new Error( ':past is not supported.' );
 		} );
-		$this->addSelector0( ':future', function ( $el ): bool {
+		$this->addSelector0( ':future', static function ( $el ): bool {
 			throw new Error( ':future is not supported.' );
 		} );
 		// Non-standard, for compatibility purposes.
-		$this->addSelector1( ':contains', function ( string $param ): callable {
-			return function ( $el ) use ( $param ): bool {
+		$this->addSelector1( ':contains', static function ( string $param ): callable {
+			return static function ( $el ) use ( $param ): bool {
 				$text = $el->textContent;
 				return strpos( $text, $param ) !== false;
 			};
@@ -687,7 +687,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	/** @return callable(DOMNode):bool */
 	private function selectorsAttr( string $key, string $op, string $val, bool $i ): callable {
 		$op = $this->operators[ $op ];
-		return function ( $el ) use ( $key, $i, $op, $val ): bool {
+		return static function ( $el ) use ( $key, $i, $op, $val ): bool {
 			/* XXX: the below all assumes a more complete PHP DOM than we have
 			switch ( $key ) {
 			#case 'for':
@@ -775,16 +775,16 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	}
 
 	private function initOperators() {
-		$this->addOperator( '-', function ( string $attr, string $val ): bool {
+		$this->addOperator( '-', static function ( string $attr, string $val ): bool {
 			return true;
 		} );
-		$this->addOperator( '=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '=', static function ( string $attr, string $val ): bool {
 			return $attr === $val;
 		} );
-		$this->addOperator( '*=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '*=', static function ( string $attr, string $val ): bool {
 			return strpos( $attr, $val ) !== false;
 		} );
-		$this->addOperator( '~=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '~=', static function ( string $attr, string $val ): bool {
 			$attrLen = strlen( $attr );
 			$valLen = strlen( $val );
 			for ( $s = 0;  $s < $attrLen;  $s = $i + 1 ) {
@@ -801,7 +801,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			}
 			return false;
 		} );
-		$this->addOperator( '|=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '|=', static function ( string $attr, string $val ): bool {
 			$i = strpos( $attr, $val );
 			if ( $i !== 0 ) {
 				return false;
@@ -813,15 +813,15 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			$l = $attr[ $j ];
 			return $l === '-';
 		} );
-		$this->addOperator( '^=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '^=', static function ( string $attr, string $val ): bool {
 			return strpos( $attr, $val ) === 0;
 		} );
-		$this->addOperator( '$=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '$=', static function ( string $attr, string $val ): bool {
 			$i = strrpos( $attr, $val );
 			return $i !== false && $i + strlen( $val ) === strlen( $attr );
 		} );
 		// non-standard
-		$this->addOperator( '!=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '!=', static function ( string $attr, string $val ): bool {
 			return $attr !== $val;
 		} );
 	}
@@ -843,8 +843,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	}
 
 	private function initCombinators() {
-		$this->addCombinator( ' ', function ( callable $test ): callable {
-			return function ( $el ) use ( $test ) {
+		$this->addCombinator( ' ', static function ( callable $test ): callable {
+			return static function ( $el ) use ( $test ) {
 				while ( $el = $el->parentNode ) {
 					if ( call_user_func( $test, $el ) ) {
 						return $el;
@@ -853,8 +853,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				return null;
 			};
 		} );
-		$this->addCombinator( '>', function ( callable $test ): callable {
-			return function ( $el ) use ( $test ) {
+		$this->addCombinator( '>', static function ( callable $test ): callable {
+			return static function ( $el ) use ( $test ) {
 				if ( $el = $el->parentNode ) {
 					if ( call_user_func( $test, $el ) ) {
 						return $el;
@@ -883,8 +883,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				return null;
 			};
 		} );
-		$this->addCombinator( 'noop', function ( callable $test ): callable {
-			return function ( $el ) use ( $test ) {
+		$this->addCombinator( 'noop', static function ( callable $test ): callable {
+			return static function ( $el ) use ( $test ) {
 				if ( call_user_func( $test, $el ) ) {
 					return $el;
 				}
@@ -912,7 +912,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return false;
 		} );
 
-		$ref->combinator = function ( $el ) use ( &$node, $name, $test ) {
+		$ref->combinator = static function ( $el ) use ( &$node, $name, $test ) {
 			if ( !$node || $node->nodeType !== 1 /* Element */ ) {
 				return null;
 			}
@@ -1128,7 +1128,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return $func[ 0 ];
 		}
 
-		return function ( $el ) use ( $l, $func ): bool {
+		return static function ( $el ) use ( $l, $func ): bool {
 			for ( $i = 0;  $i < $l;  $i++ ) {
 				if ( !call_user_func( $func[ $i ], $el ) ) {
 					return false;
@@ -1141,11 +1141,11 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	// Returns the element that all $func return
 	private static function makeTest( array $func ): ZestFunc {
 		if ( count( $func ) < 2 ) {
-			return new ZestFunc( function ( $el ) use ( $func ): bool {
+			return new ZestFunc( static function ( $el ) use ( $func ): bool {
 				return (bool)call_user_func( $func[ 0 ], $el );
 			} );
 		}
-		return new ZestFunc( function ( $el ) use ( $func ): bool {
+		return new ZestFunc( static function ( $el ) use ( $func ): bool {
 			$i = count( $func );
 			while ( $i-- ) {
 				if ( !( $el = call_user_func( $func[ $i ], $el ) ) ) {
@@ -1175,7 +1175,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return false;
 		} );
 
-		$subject->simple = function ( $el ): bool {
+		$subject->simple = static function ( $el ): bool {
 			$target = $el;
 			return true;
 		};
@@ -1200,7 +1200,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		}
 
 		// Optional "$ignore" parameter here lets this be passed to nth()
-		return function ( $el, $ignore = null ) use ( $tests ): bool {
+		return static function ( $el, $ignore = null ) use ( $tests ): bool {
 			for ( $i = 0, $l = count( $tests );  $i < $l;  $i++ ) {
 				if ( call_user_func( $tests[ $i ]->func, $el ) ) {
 					return true;
@@ -1297,7 +1297,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	 * @return bool True iff the element matches the selector
 	 */
 	public function matches( $el, string $sel ): bool {
-		$test = new ZestFunc( function ( $el ):bool {
+		$test = new ZestFunc( static function ( $el ):bool {
 			return true;
 		} );
 		$test->sel = $sel;
diff --git a/tests/ZestInstTest.php b/tests/ZestInstTest.php
index 2bf66b9..e6d5ed8 100644
--- a/tests/ZestInstTest.php
+++ b/tests/ZestInstTest.php
@@ -67,7 +67,7 @@ class ZestInstTest extends \PHPUnit\Framework\TestCase {
 		$z0 = new ZestInst;
 		// Verify that we can create a custom selector
 		$z1 = new ZestInst;
-		$z1->addSelector0( ':zesttest', function ( DOMNode $el ):bool {
+		$z1->addSelector0( ':zesttest', static function ( DOMNode $el ):bool {
 			return strtolower( $el->nodeName ) === 'footer' &&
 				strtolower( $el->parentNode->nodeName ) === 'article';
 		} );
-- 
2.20.1

$ date
Wed May  5 11:11:34 UTC 2021

$ git clone file:///srv/git/mediawiki-libs-Zest.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
8cbd3a460212477741a87656fd487172078d0dae 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: 64 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 psr/log (1.1.4): Loading from cache
  - Installing sabre/event (5.1.2): Loading from cache
  - Installing netresearch/jsonmapper (v2.1.0): Loading from cache
  - Installing microsoft/tolerant-php-parser (v0.0.23): 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 felixfbecker/advanced-json-rpc (v3.2.0): Loading from cache
  - Installing composer/xdebug-handler (1.4.6): Loading from cache
  - Installing phan/phan (3.2.6): Loading from cache
  - Installing mediawiki/phan-taint-check-plugin (3.2.1): Loading from cache
  - Installing mediawiki/mediawiki-phan-config (0.10.6): Loading from cache
  - Installing mediawiki/minus-x (1.1.1): Loading from cache
  - Installing sebastian/version (3.0.2): Loading from cache
  - Installing sebastian/type (2.3.1): Loading from cache
  - Installing sebastian/resource-operations (3.0.3): Loading from cache
  - Installing sebastian/recursion-context (4.0.4): Loading from cache
  - Installing sebastian/object-reflector (2.0.4): Loading from cache
  - Installing sebastian/object-enumerator (4.0.4): Loading from cache
  - Installing sebastian/global-state (5.0.2): Loading from cache
  - Installing sebastian/exporter (4.0.3): Loading from cache
  - Installing sebastian/environment (5.1.3): Loading from cache
  - Installing sebastian/diff (4.0.4): Loading from cache
  - Installing sebastian/comparator (4.0.6): Loading from cache
  - Installing sebastian/code-unit (1.0.8): Loading from cache
  - Installing sebastian/cli-parser (1.0.1): Loading from cache
  - Installing phpunit/php-timer (5.0.3): Loading from cache
  - Installing phpunit/php-text-template (2.0.4): Loading from cache
  - Installing phpunit/php-invoker (3.1.1): Loading from cache
  - Installing phpunit/php-file-iterator (3.0.5): Loading from cache
  - Installing theseer/tokenizer (1.2.0): Loading from cache
  - Installing nikic/php-parser (v4.10.5): Loading from cache
  - Installing sebastian/lines-of-code (1.0.3): Loading from cache
  - Installing sebastian/complexity (2.0.2): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Loading from cache
  - Installing phpunit/php-code-coverage (9.2.6): Loading from cache
  - Installing doctrine/instantiator (1.4.0): Loading from cache
  - Installing phpspec/prophecy (1.13.0): Loading from cache
  - Installing phar-io/version (3.1.0): Loading from cache
  - Installing phar-io/manifest (2.0.1): Loading from cache
  - Installing myclabs/deep-copy (1.10.2): Loading from cache
  - Installing phpunit/phpunit (9.5.4): 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
  - Installing wikimedia/testing-access-wrapper (1.0.0): Loading from cache
  - Installing wikimedia/utfnormal (3.0.2): Loading from cache
  - Installing wikimedia/remex-html (2.3.1): 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
phan/phan suggests installing ext-ast (Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.8+ is recommended.)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-pcov (*)
phpunit/php-code-coverage suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing ext-soap (*)
phpunit/phpunit suggests installing ext-xdebug (*)
Writing lock file
Generating autoload files
37 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
Writing lock file
Generating autoload files
37 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

{'MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment', 'Generic.Files.LineLength.TooLong', 'MediaWiki.Commenting.FunctionComment.MissingParamTag', 'Squiz.Scope.MethodScope.Missing', 'MediaWiki.Commenting.MissingCovers.MissingCovers', 'MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures', 'MediaWiki.Commenting.FunctionComment.WrongStyle', 'MediaWiki.Commenting.FunctionComment.SpacingAfter', 'MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate', 'MediaWiki.Commenting.FunctionComment.MissingReturn', 'MediaWiki.Commenting.FunctionComment.ParamNameNoMatch'}
Tests fail!
$ vendor/bin/phpcbf

PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE                                                  FIXED  REMAINING
----------------------------------------------------------------------
/src/repo/tests/ZestInstTest.php                      1      5
/src/repo/src/ZestInst.php                            52     44
----------------------------------------------------------------------
A TOTAL OF 53 ERRORS WERE FIXED IN 2 FILES
----------------------------------------------------------------------

Time: 773ms; Memory: 32MB



$ 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
Generating autoload files
37 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
......                                                       6/6 (100 %)


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

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

...............................................................  63 / 116 ( 54%)
.....................................................           116 / 116 (100%)

Time: 00:00.129, Memory: 8.00 MB

OK (116 tests, 1053 assertions)
> phan --allow-polyfill-parser
Parsing files...
░░░                                                    3 / 3 (100%) 16MB
Analyzing classes...
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 33MB
Analyzing functions...
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 33MB
Analyzing methods...
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 33MB
Analyzing files...
░░░                                                    3 / 3 (100%) 43MB

> covers-validator
CoversValidator 1.3.3

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


Time: 326ms; Memory: 22MB

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

$ git add .

$ git commit -F /tmp/tmpywwojj0w
[master 21cfac8] build: Updating composer dependencies
 4 files changed, 55 insertions(+), 56 deletions(-)

$ git format-patch HEAD~1 --stdout
From 21cfac8bee9fd0c3d3175d1a8beed211daff7c8a Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Wed, 5 May 2021 11:11:53 +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
  The following sniffs now pass and were enabled:
  * MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: Ic1aeb29eb0e27dc0f1f78d41c5ec179bbbb22c05
---
 .phpcs.xml             |   1 -
 composer.json          |   4 +-
 src/ZestInst.php       | 104 ++++++++++++++++++++---------------------
 tests/ZestInstTest.php |   2 +-
 4 files changed, 55 insertions(+), 56 deletions(-)

diff --git a/.phpcs.xml b/.phpcs.xml
index 1ad439a..a2bd8af 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -8,7 +8,6 @@
 		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
-		<exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
 		<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
 		<exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
diff --git a/composer.json b/composer.json
index 9debae9..d8b648b 100644
--- a/composer.json
+++ b/composer.json
@@ -26,12 +26,12 @@
 		"ext-intl": "*"
 	},
 	"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",
 		"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 || ^9.5",
 		"wikimedia/remex-html": "^2.2.2 || ^2.3",
 		"wikimedia/testing-access-wrapper": "~1.0"
diff --git a/src/ZestInst.php b/src/ZestInst.php
index ef40df1..f49a2fe 100644
--- a/src/ZestInst.php
+++ b/src/ZestInst.php
@@ -194,7 +194,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	private static function xpathQuote( string $s ): string {
 		// Ugly-but-functional escape mechanism for xpath query
 		$parts = explode( "'", $s );
-		$parts = array_map( function ( string $ss ) {
+		$parts = array_map( static function ( string $ss ) {
 			return "'$ss'";
 		}, $parts );
 		if ( count( $parts ) === 1 ) {
@@ -412,12 +412,12 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	}
 
 	private function initSelectors() {
-		$this->addSelector0( '*', function ( $el ): bool {
+		$this->addSelector0( '*', static function ( $el ): bool {
 			return true;
 		} );
-		$this->addSelector1( 'type', function ( string $type ): callable {
+		$this->addSelector1( 'type', static function ( string $type ): callable {
 			$type = strtolower( $type );
-			return function ( $el ) use ( $type ): bool {
+			return static function ( $el ) use ( $type ): bool {
 				return strtolower( $el->nodeName ) === $type;
 			};
 		} );
@@ -432,7 +432,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				&& self::parentIsElement( $el );
 		} );
 		$this->addSelector1( ':nth-child', function ( string $param, bool $last = false ): callable {
-			return self::nth( $param, function ( $ignore1, $ignore2 ) {
+			return self::nth( $param, static function ( $ignore1, $ignore2 ) {
 				return true;
 			}, $last );
 		} );
@@ -440,15 +440,15 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector1( ':nth-last-child', function ( string $param ): callable {
 			return $this->selectors1[ ':nth-child' ]( $param, true );
 		} );
-		$this->addSelector0( ':root', function ( $el ): bool {
+		$this->addSelector0( ':root', static function ( $el ): bool {
 			return $el->ownerDocument->documentElement === $el;
 		} );
-		$this->addSelector0( ':empty', function ( $el ): bool {
+		$this->addSelector0( ':empty', static function ( $el ): bool {
 			return !$el->firstChild;
 		} );
 		$this->addSelector1( ':not', function ( string $sel ) {
 			$test = self::compileGroup( $sel );
-			return function ( $el ) use ( $test ): bool {
+			return static function ( $el ) use ( $test ): bool {
 				return !call_user_func( $test, $el );
 			};
 		} );
@@ -481,7 +481,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				$this->selectors0[ ':last-of-type' ]( $el );
 		} );
 		$this->addSelector1( ':nth-of-type', function ( string $param, bool $last = false ): callable  {
-			return self::nth( $param, function ( $rel, $el ) {
+			return self::nth( $param, static function ( $rel, $el ) {
 				return $rel->nodeName === $el->nodeName;
 			}, $last );
 		} );
@@ -489,7 +489,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector1( ':nth-last-of-type', function ( string $param ): callable {
 			return $this->selectors1[ ':nth-of-type' ]( $param, true );
 		} );
-		$this->addSelector0( ':checked', function ( $el ): bool {
+		$this->addSelector0( ':checked', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			// XXX these properties don't exist in the PHP DOM
 			// return $el->checked || $el->selected;
@@ -498,13 +498,13 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector0( ':indeterminate', function ( $el ): bool {
 			return !$this->selectors0[ ':checked' ]( $el );
 		} );
-		$this->addSelector0( ':enabled', function ( $el ): bool {
+		$this->addSelector0( ':enabled', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			// XXX these properties don't exist in the PHP DOM
 			// return !$el->disabled && $el->type !== 'hidden';
 			return !$el->hasAttribute( 'disabled' ) && $el->getAttribute( 'type' ) !== 'hidden';
 		} );
-		$this->addSelector0( ':disabled', function ( $el ): bool {
+		$this->addSelector0( ':disabled', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			// XXX these properties don't exist in the PHP DOM
 			// return !!$el->disabled;
@@ -542,8 +542,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return $el . '' === $window->location . '';
 		});
 		*/
-		$this->addSelector1( ':lang', function ( string $param ): callable {
-			return function ( $el ) use ( $param ): bool {
+		$this->addSelector1( ':lang', static function ( string $param ): callable {
+			return static function ( $el ) use ( $param ): bool {
 				'@phan-var DOMElement $el';
 				while ( $el ) {
 					// PHP DOM doesn't have 'lang' property
@@ -556,8 +556,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				return false;
 			};
 		} );
-		$this->addSelector1( ':dir', function ( string $param ): callable {
-			return function ( $el ) use ( $param ): bool {
+		$this->addSelector1( ':dir', static function ( string $param ): callable {
+			return static function ( $el ) use ( $param ): bool {
 				'@phan-var DOMElement $el';
 				while ( $el ) {
 					$dir = $el->getAttribute( 'dir' );
@@ -613,14 +613,14 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector0( ':out-of-range', function ( $el ): bool {
 			return !$this->selectors0[ ':in-range' ]( $el );
 		} );
-		$this->addSelector0( ':required', function ( $el ): bool {
+		$this->addSelector0( ':required', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			return $el->hasAttribute( 'required' );
 		} );
 		$this->addSelector0( ':optional', function ( $el ): bool {
 			return !$this->selectors0[ ':required' ]( $el );
 		} );
-		$this->addSelector0( ':read-only', function ( $el ): bool {
+		$this->addSelector0( ':read-only', static function ( $el ): bool {
 			'@phan-var DOMElement $el';
 			if ( $el->hasAttribute( 'readOnly' ) ) {
 				return true;
@@ -636,39 +636,39 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		$this->addSelector0( ':read-write', function ( $el ): bool {
 			return !$this->selectors0[ ':read-only' ]( $el );
 		} );
-		$this->addSelector0( ':hover', function ( $el ): bool {
+		$this->addSelector0( ':hover', static function ( $el ): bool {
 			throw new Error( ':hover is not supported.' );
 		} );
-		$this->addSelector0( ':active', function ( $el ): bool {
+		$this->addSelector0( ':active', static function ( $el ): bool {
 			throw new Error( ':active is not supported.' );
 		} );
-		$this->addSelector0( ':link', function ( $el ): bool {
+		$this->addSelector0( ':link', static function ( $el ): bool {
 			throw new Error( ':link is not supported.' );
 		} );
-		$this->addSelector0( ':visited', function ( $el ): bool {
+		$this->addSelector0( ':visited', static function ( $el ): bool {
 			throw new Error( ':visited is not supported.' );
 		} );
-		$this->addSelector0( ':column', function ( $el ): bool {
+		$this->addSelector0( ':column', static function ( $el ): bool {
 			throw new Error( ':column is not supported.' );
 		} );
-		$this->addSelector0( ':nth-column', function ( $el ): bool {
+		$this->addSelector0( ':nth-column', static function ( $el ): bool {
 			throw new Error( ':nth-column is not supported.' );
 		} );
-		$this->addSelector0( ':nth-last-column', function ( $el ): bool {
+		$this->addSelector0( ':nth-last-column', static function ( $el ): bool {
 			throw new Error( ':nth-last-column is not supported.' );
 		} );
-		$this->addSelector0( ':current', function ( $el ): bool {
+		$this->addSelector0( ':current', static function ( $el ): bool {
 			throw new Error( ':current is not supported.' );
 		} );
-		$this->addSelector0( ':past', function ( $el ): bool {
+		$this->addSelector0( ':past', static function ( $el ): bool {
 			throw new Error( ':past is not supported.' );
 		} );
-		$this->addSelector0( ':future', function ( $el ): bool {
+		$this->addSelector0( ':future', static function ( $el ): bool {
 			throw new Error( ':future is not supported.' );
 		} );
 		// Non-standard, for compatibility purposes.
-		$this->addSelector1( ':contains', function ( string $param ): callable {
-			return function ( $el ) use ( $param ): bool {
+		$this->addSelector1( ':contains', static function ( string $param ): callable {
+			return static function ( $el ) use ( $param ): bool {
 				$text = $el->textContent;
 				return strpos( $text, $param ) !== false;
 			};
@@ -687,7 +687,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	/** @return callable(DOMNode):bool */
 	private function selectorsAttr( string $key, string $op, string $val, bool $i ): callable {
 		$op = $this->operators[ $op ];
-		return function ( $el ) use ( $key, $i, $op, $val ): bool {
+		return static function ( $el ) use ( $key, $i, $op, $val ): bool {
 			/* XXX: the below all assumes a more complete PHP DOM than we have
 			switch ( $key ) {
 			#case 'for':
@@ -775,16 +775,16 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	}
 
 	private function initOperators() {
-		$this->addOperator( '-', function ( string $attr, string $val ): bool {
+		$this->addOperator( '-', static function ( string $attr, string $val ): bool {
 			return true;
 		} );
-		$this->addOperator( '=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '=', static function ( string $attr, string $val ): bool {
 			return $attr === $val;
 		} );
-		$this->addOperator( '*=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '*=', static function ( string $attr, string $val ): bool {
 			return strpos( $attr, $val ) !== false;
 		} );
-		$this->addOperator( '~=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '~=', static function ( string $attr, string $val ): bool {
 			$attrLen = strlen( $attr );
 			$valLen = strlen( $val );
 			for ( $s = 0;  $s < $attrLen;  $s = $i + 1 ) {
@@ -801,7 +801,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			}
 			return false;
 		} );
-		$this->addOperator( '|=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '|=', static function ( string $attr, string $val ): bool {
 			$i = strpos( $attr, $val );
 			if ( $i !== 0 ) {
 				return false;
@@ -813,15 +813,15 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			$l = $attr[ $j ];
 			return $l === '-';
 		} );
-		$this->addOperator( '^=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '^=', static function ( string $attr, string $val ): bool {
 			return strpos( $attr, $val ) === 0;
 		} );
-		$this->addOperator( '$=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '$=', static function ( string $attr, string $val ): bool {
 			$i = strrpos( $attr, $val );
 			return $i !== false && $i + strlen( $val ) === strlen( $attr );
 		} );
 		// non-standard
-		$this->addOperator( '!=', function ( string $attr, string $val ): bool {
+		$this->addOperator( '!=', static function ( string $attr, string $val ): bool {
 			return $attr !== $val;
 		} );
 	}
@@ -843,8 +843,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	}
 
 	private function initCombinators() {
-		$this->addCombinator( ' ', function ( callable $test ): callable {
-			return function ( $el ) use ( $test ) {
+		$this->addCombinator( ' ', static function ( callable $test ): callable {
+			return static function ( $el ) use ( $test ) {
 				while ( $el = $el->parentNode ) {
 					if ( call_user_func( $test, $el ) ) {
 						return $el;
@@ -853,8 +853,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				return null;
 			};
 		} );
-		$this->addCombinator( '>', function ( callable $test ): callable {
-			return function ( $el ) use ( $test ) {
+		$this->addCombinator( '>', static function ( callable $test ): callable {
+			return static function ( $el ) use ( $test ) {
 				if ( $el = $el->parentNode ) {
 					if ( call_user_func( $test, $el ) ) {
 						return $el;
@@ -883,8 +883,8 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 				return null;
 			};
 		} );
-		$this->addCombinator( 'noop', function ( callable $test ): callable {
-			return function ( $el ) use ( $test ) {
+		$this->addCombinator( 'noop', static function ( callable $test ): callable {
+			return static function ( $el ) use ( $test ) {
 				if ( call_user_func( $test, $el ) ) {
 					return $el;
 				}
@@ -912,7 +912,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return false;
 		} );
 
-		$ref->combinator = function ( $el ) use ( &$node, $name, $test ) {
+		$ref->combinator = static function ( $el ) use ( &$node, $name, $test ) {
 			if ( !$node || $node->nodeType !== 1 /* Element */ ) {
 				return null;
 			}
@@ -1128,7 +1128,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return $func[ 0 ];
 		}
 
-		return function ( $el ) use ( $l, $func ): bool {
+		return static function ( $el ) use ( $l, $func ): bool {
 			for ( $i = 0;  $i < $l;  $i++ ) {
 				if ( !call_user_func( $func[ $i ], $el ) ) {
 					return false;
@@ -1141,11 +1141,11 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	// Returns the element that all $func return
 	private static function makeTest( array $func ): ZestFunc {
 		if ( count( $func ) < 2 ) {
-			return new ZestFunc( function ( $el ) use ( $func ): bool {
+			return new ZestFunc( static function ( $el ) use ( $func ): bool {
 				return (bool)call_user_func( $func[ 0 ], $el );
 			} );
 		}
-		return new ZestFunc( function ( $el ) use ( $func ): bool {
+		return new ZestFunc( static function ( $el ) use ( $func ): bool {
 			$i = count( $func );
 			while ( $i-- ) {
 				if ( !( $el = call_user_func( $func[ $i ], $el ) ) ) {
@@ -1175,7 +1175,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 			return false;
 		} );
 
-		$subject->simple = function ( $el ): bool {
+		$subject->simple = static function ( $el ): bool {
 			$target = $el;
 			return true;
 		};
@@ -1200,7 +1200,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 		}
 
 		// Optional "$ignore" parameter here lets this be passed to nth()
-		return function ( $el, $ignore = null ) use ( $tests ): bool {
+		return static function ( $el, $ignore = null ) use ( $tests ): bool {
 			for ( $i = 0, $l = count( $tests );  $i < $l;  $i++ ) {
 				if ( call_user_func( $tests[ $i ]->func, $el ) ) {
 					return true;
@@ -1297,7 +1297,7 @@ $order = function ( $a, $b ) use ( &$compareDocumentPosition ) {
 	 * @return bool True iff the element matches the selector
 	 */
 	public function matches( $el, string $sel ): bool {
-		$test = new ZestFunc( function ( $el ):bool {
+		$test = new ZestFunc( static function ( $el ):bool {
 			return true;
 		} );
 		$test->sel = $sel;
diff --git a/tests/ZestInstTest.php b/tests/ZestInstTest.php
index 2bf66b9..e6d5ed8 100644
--- a/tests/ZestInstTest.php
+++ b/tests/ZestInstTest.php
@@ -67,7 +67,7 @@ class ZestInstTest extends \PHPUnit\Framework\TestCase {
 		$z0 = new ZestInst;
 		// Verify that we can create a custom selector
 		$z1 = new ZestInst;
-		$z1->addSelector0( ':zesttest', function ( DOMNode $el ):bool {
+		$z1->addSelector0( ':zesttest', static function ( DOMNode $el ):bool {
 			return strtolower( $el->nodeName ) === 'footer' &&
 				strtolower( $el->parentNode->nodeName ) === 'article';
 		} );
-- 
2.20.1

composer dependencies

Dependencies
Development dependencies

Logs

Source code is licensed under the AGPL.