mediawiki/libs/Dodo: main (log #273164)

sourcepatches

This run took 114 seconds.

From 51c77b1dbcb1875285f5cee699c89580fab1f2b5 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Sat, 15 May 2021 16:30:40 +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

Additional changes:
* Committed package-lock.json (T179229) too.

Change-Id: Iedab978cbf3cff3e48aa392527701a4d282b1bf7
---
 .gitignore                           |  1 -
 composer.json                        | 20 ++++++++++----------
 package-lock.json                    | 22 ++++++++++++++++++++++
 src/DOMTokenList.php                 |  2 +-
 src/Element.php                      |  4 ++--
 src/Internal/Util.php                |  4 ++--
 src/Internal/WhatWG.php              |  2 +-
 tests/DodoTest.php                   |  4 ++--
 tools/TestsGenerator/LocatorTask.php |  2 +-
 tools/TestsGenerator/ParserTask.php  |  6 +++---
 10 files changed, 44 insertions(+), 23 deletions(-)
 create mode 100644 package-lock.json

diff --git a/.gitignore b/.gitignore
index 404e581..7fa6d42 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,4 @@
 /.idea
 /.phpunit.result.cache
 /node_modules
-package-lock.json
 /.docksal
diff --git a/composer.json b/composer.json
index 70608f2..de73dfd 100644
--- a/composer.json
+++ b/composer.json
@@ -60,23 +60,23 @@
 		"wikimedia/zest-css": "^1.1.5"
 	},
 	"require-dev": {
-		"mediawiki/mediawiki-codesniffer": "35.0.0",
+		"consolidation/robo": "^3@alpha",
+		"fgnass/domino": "^2.1",
+		"league/container": "^3",
+		"lstrojny/functional-php": "^1.17",
+		"mediawiki/mediawiki-codesniffer": "36.0.0",
 		"mediawiki/mediawiki-phan-config": "0.10.6",
 		"mediawiki/minus-x": "1.1.1",
+		"mockery/mockery": "1.3.1|^1.4",
+		"nette/php-generator": "^3.5",
+		"nikic/php-parser": "^4.10",
 		"ockcyp/covers-validator": "1.3.3",
 		"php-parallel-lint/php-console-highlighter": "^0.5",
-		"php-parallel-lint/php-parallel-lint": "1.2.0",
+		"php-parallel-lint/php-parallel-lint": "1.3.0",
 		"phpunit/phpunit": "^8.5|^9.5",
-		"nikic/php-parser": "^4.10",
-		"nette/php-generator": "^3.5",
-		"fgnass/domino": "^2.1",
-		"league/container": "^3",
-		"consolidation/robo": "^3@alpha",
 		"web-platform-tests/wpt": "^2.7",
-		"mockery/mockery": "1.3.1|^1.4",
 		"webmozart/assert": "^1.10",
-		"webmozart/path-util": "^2.3",
-		"lstrojny/functional-php": "^1.17"
+		"webmozart/path-util": "^2.3"
 	},
 	"scripts": {
 		"test": [
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..b2ac5be
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,22 @@
+{
+	"name": "wikimedia-dodo",
+	"version": "0.0.1",
+	"lockfileVersion": 1,
+	"requires": true,
+	"dependencies": {
+		"espree": {
+			"version": "2.2.5",
+			"resolved": "https://registry.npmjs.org/espree/-/espree-2.2.5.tgz",
+			"integrity": "sha1-32kbkxCIlAKuspzAZnCMVmkLhUs=",
+			"dev": true
+		},
+		"js2php": {
+			"version": "github:drynok/js2php#a38d2162c210fd83520ee38fdcf2563667a49709",
+			"from": "github:drynok/js2php",
+			"dev": true,
+			"requires": {
+				"espree": "~2.2.3"
+			}
+		}
+	}
+}
diff --git a/src/DOMTokenList.php b/src/DOMTokenList.php
index b7f0c1f..1363af7 100644
--- a/src/DOMTokenList.php
+++ b/src/DOMTokenList.php
@@ -152,7 +152,7 @@ class DOMTokenList implements \Wikimedia\IDLeDOM\DOMTokenList {
 		}
 
 		foreach ( $tokens as $token ) {
-			$this->_list = array_filter( $this->_list, function ( $e ) use ( $token ){
+			$this->_list = array_filter( $this->_list, static function ( $e ) use ( $token ){
 				return $e !== $token;
 			} );
 		}
diff --git a/src/Element.php b/src/Element.php
index 00f70b6..14a2370 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -93,7 +93,7 @@ class Element extends ContainerNode implements \Wikimedia\IDLeDOM\Element {
 	public static function _attributeChangeHandlerFor( string $localName ) {
 		if ( static::$_attributeChangeHandlers === null ) {
 			static::$_attributeChangeHandlers = [
-				"id" => function ( $elem, $old, $new ) {
+				"id" => static function ( $elem, $old, $new ) {
 					if ( !$elem->_isRooted() ) {
 						return;
 					}
@@ -104,7 +104,7 @@ class Element extends ContainerNode implements \Wikimedia\IDLeDOM\Element {
 						$elem->_ownerDocument->_addToIdTable( $new, $elem );
 					}
 				},
-				"class" => function ( $elem, $old, $new ) {
+				"class" => static function ( $elem, $old, $new ) {
 					if ( $elem->_classList !== null ) {
 						$elem->_classList->_getList();
 					}
diff --git a/src/Internal/Util.php b/src/Internal/Util.php
index 4848042..01047d9 100644
--- a/src/Internal/Util.php
+++ b/src/Internal/Util.php
@@ -91,7 +91,7 @@ class Util {
 	 * @return string
 	 */
 	public static function ascii_to_lowercase( string $s ): string {
-		return preg_replace_callback( '/[A-Z]+/', function ( $matches ) {
+		return preg_replace_callback( '/[A-Z]+/', static function ( $matches ) {
 			return strtolower( $matches[0] );
 		}, $s );
 	}
@@ -101,7 +101,7 @@ class Util {
 	 * @return string
 	 */
 	public static function ascii_to_uppercase( string $s ): string {
-		return preg_replace_callback( '/[a-z]+/', function ( $matches ) {
+		return preg_replace_callback( '/[a-z]+/', static function ( $matches ) {
 			return strtoupper( $matches[0] );
 		}, $s );
 	}
diff --git a/src/Internal/WhatWG.php b/src/Internal/WhatWG.php
index d011176..f396ff2 100644
--- a/src/Internal/WhatWG.php
+++ b/src/Internal/WhatWG.php
@@ -231,7 +231,7 @@ class WhatWG {
 				return self::locate_prefix( $node->_documentElement, $ns );
 			}
 			break;
-		case  Node::ATTRIBUTE_NODE:
+		case Node::ATTRIBUTE_NODE:
 			if ( $node->_ownerElement ) {
 				return self::locate_prefix( $node->_ownerElement, $ns );
 			}
diff --git a/tests/DodoTest.php b/tests/DodoTest.php
index c4e1e02..3f1daeb 100644
--- a/tests/DodoTest.php
+++ b/tests/DodoTest.php
@@ -83,7 +83,7 @@ class DodoTest extends \PHPUnit\Framework\TestCase {
 	/** @dataProvider provideFixture */
 	public function testNodeIterator1( Document $doc ) {
 		$root = $doc->getElementById( 'tw' );
-		$ni = $doc->createNodeIterator( $root, NodeFilter::SHOW_TEXT, function ( $n ) {
+		$ni = $doc->createNodeIterator( $root, NodeFilter::SHOW_TEXT, static function ( $n ) {
 			return ( $n->data === 'ignore' ) ?
 				NodeFilter::FILTER_REJECT : NodeFilter::FILTER_ACCEPT;
 		} );
@@ -115,7 +115,7 @@ class DodoTest extends \PHPUnit\Framework\TestCase {
 		$ni = $doc->createNodeIterator(
 			$body,
 			NodeFilter::SHOW_ELEMENT | NodeFilter::SHOW_COMMENT | NodeFilter::SHOW_TEXT,
-			function ( $n ) { return NodeFilter::FILTER_ACCEPT;
+			static function ( $n ) { return NodeFilter::FILTER_ACCEPT;
 			}
 		);
 		$node = $ni->nextNode();
diff --git a/tools/TestsGenerator/LocatorTask.php b/tools/TestsGenerator/LocatorTask.php
index e94b31e..6f514b3 100644
--- a/tools/TestsGenerator/LocatorTask.php
+++ b/tools/TestsGenerator/LocatorTask.php
@@ -144,7 +144,7 @@ class LocatorTask extends BaseTask {
 		];
 
 		array_walk( $skips,
-			function ( &$item, $key ) {
+			static function ( &$item, $key ) {
 				$item .= '.*';
 			} );
 		/**
diff --git a/tools/TestsGenerator/ParserTask.php b/tools/TestsGenerator/ParserTask.php
index a295c3e..a9d4d34 100644
--- a/tools/TestsGenerator/ParserTask.php
+++ b/tools/TestsGenerator/ParserTask.php
@@ -825,7 +825,7 @@ class ParserTask extends BaseTask {
 	 */
 	protected function findFuncCall( array $ast, string $name ) : ?Node {
 		return $this->finder->findFirst( $ast,
-			function ( $node ) use ( $name ) {
+			static function ( $node ) use ( $name ) {
 				if ( isset( $node->expr ) && isset( $node->expr->name ) && $node->expr instanceof FuncCall ) {
 					$expr_name = $node->expr->name->toString();
 					if ( $expr_name == $name ) {
@@ -885,12 +885,12 @@ class ParserTask extends BaseTask {
 	private function prepareAst( array $ast ) {
 		$main_method = $this->snakeToCamel( 'test ' . $this->test_name );
 
-		$functions = $this->finder->find( $ast, function ( $node ) {
+		$functions = $this->finder->find( $ast, static function ( $node ) {
 			return $node instanceof Function_;
 		} );
 
 		$ast = array_filter( $ast,
-			function ( $smtm ) {
+			static function ( $smtm ) {
 				if ( !$smtm instanceof Function_ ) {
 					return $smtm;
 				}
-- 
2.20.1

**purged**
Source code is licensed under the AGPL.