mediawiki/extensions/UseResource (master)

sourcepatches
From 13da164175bcc2e9d296496d08a957a81f2f9ca7 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Fri, 7 May 2021 03:05: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
* mediawiki/minus-x: 1.1.0 → 1.1.1
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Additional changes:
* Added the "composer phan" command to conveniently run phan.

Change-Id: I63faaec0c3bb0f77fd97bfba7e9d5a81756bf79a
---
 composer.json                           |  9 +++++----
 tests/phpunit/integration/HooksTest.php | 20 ++++++++++----------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/composer.json b/composer.json
index 2eaad41..1dc9038 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,11 @@
 {
 	"license": "GPL-2.0-or-later",
 	"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.0",
+		"mediawiki/minus-x": "1.1.1",
 		"php-parallel-lint/php-console-highlighter": "0.5.0",
-		"php-parallel-lint/php-parallel-lint": "1.2.0"
+		"php-parallel-lint/php-parallel-lint": "1.3.0"
 	},
 	"scripts": {
 		"fix": [
@@ -16,6 +16,7 @@
 			"parallel-lint . --exclude vendor --exclude node_modules",
 			"phpcs -p -s",
 			"minus-x check ."
-		]
+		],
+		"phan": "phan -d . --long-progress-bar"
 	}
 }
diff --git a/tests/phpunit/integration/HooksTest.php b/tests/phpunit/integration/HooksTest.php
index 0d9308c..c7209f0 100644
--- a/tests/phpunit/integration/HooksTest.php
+++ b/tests/phpunit/integration/HooksTest.php
@@ -218,7 +218,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with empty content' => [
 				'<usescript src="MediaWiki:UseResourceTest.js"></usescript>',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -228,7 +228,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with content' => [
 				'<usescript src="MediaWiki:UseResourceTest.js">Some text</usescript>',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -286,7 +286,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with valid namespace' => [
 				'<usescript src="MediaWiki:UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -296,7 +296,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag without namespace' => [
 				'<usescript src="UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -306,7 +306,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with empty page' => [
 				'<usescript src="MediaWiki:UseResourceTest2.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[1] ]
 					];
@@ -315,7 +315,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Two tags' => [
 				'<usescript src="MediaWiki:UseResourceTest.js" /><usescript src="MediaWiki:UseResourceTest3.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0], $ids[2] ],
 						'js' => '!function(){console.log(7)}();!function(){alert(8)}();'
@@ -325,7 +325,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Two of the same tag'  => [
 				'<usescript src="MediaWiki:UseResourceTest.js" /><usescript src="MediaWiki:UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -335,7 +335,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Only a usestyle tag' => [
 				'<usestyle src="MediaWiki:UseResourceTest.css" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[3] ],
 						'css' => '*{color:red}'
@@ -345,7 +345,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Only a usescript tag' => [
 				'<usescript src="MediaWiki:UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -355,7 +355,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Both usestyle and usescript tags'  => [
 				'<usescript src="MediaWiki:UseResourceTest.js" /><usestyle src="MediaWiki:UseResourceTest.css" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0], $ids[3] ],
 						'js' => '!function(){console.log(7)}();',
-- 
2.20.1

$ date
Fri May  7 03:05:33 UTC 2021

$ git clone file:///srv/git/mediawiki-extensions-UseResource.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
1371f5408273a672b52e3effec3254cec3493166 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: 31 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.0): 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
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.)
Writing lock file
Generating autoload files
12 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:mediawiki/minus-x from 1.1.0 -> 1.1.1
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, 4 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 mediawiki/minus-x (1.1.0 => 1.1.1): 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
12 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/phpunit/integration/HooksTest.php     10     0
----------------------------------------------------------------------
A TOTAL OF 10 ERRORS WERE FIXED IN 1 FILE
----------------------------------------------------------------------

Time: 168ms; 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
Generating autoload files
12 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

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


Checked 5 files in 0 seconds
No syntax error found
> phpcs -p -s
..... 5 / 5 (100%)


Time: 126ms; Memory: 10MB

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

$ git add .

$ git commit -F /tmp/tmpmuob94at
[master 13da164] build: Updating composer dependencies
 2 files changed, 15 insertions(+), 14 deletions(-)

$ git format-patch HEAD~1 --stdout
From 13da164175bcc2e9d296496d08a957a81f2f9ca7 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Fri, 7 May 2021 03:05: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
* mediawiki/minus-x: 1.1.0 → 1.1.1
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Additional changes:
* Added the "composer phan" command to conveniently run phan.

Change-Id: I63faaec0c3bb0f77fd97bfba7e9d5a81756bf79a
---
 composer.json                           |  9 +++++----
 tests/phpunit/integration/HooksTest.php | 20 ++++++++++----------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/composer.json b/composer.json
index 2eaad41..1dc9038 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,11 @@
 {
 	"license": "GPL-2.0-or-later",
 	"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.0",
+		"mediawiki/minus-x": "1.1.1",
 		"php-parallel-lint/php-console-highlighter": "0.5.0",
-		"php-parallel-lint/php-parallel-lint": "1.2.0"
+		"php-parallel-lint/php-parallel-lint": "1.3.0"
 	},
 	"scripts": {
 		"fix": [
@@ -16,6 +16,7 @@
 			"parallel-lint . --exclude vendor --exclude node_modules",
 			"phpcs -p -s",
 			"minus-x check ."
-		]
+		],
+		"phan": "phan -d . --long-progress-bar"
 	}
 }
diff --git a/tests/phpunit/integration/HooksTest.php b/tests/phpunit/integration/HooksTest.php
index 0d9308c..c7209f0 100644
--- a/tests/phpunit/integration/HooksTest.php
+++ b/tests/phpunit/integration/HooksTest.php
@@ -218,7 +218,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with empty content' => [
 				'<usescript src="MediaWiki:UseResourceTest.js"></usescript>',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -228,7 +228,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with content' => [
 				'<usescript src="MediaWiki:UseResourceTest.js">Some text</usescript>',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -286,7 +286,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with valid namespace' => [
 				'<usescript src="MediaWiki:UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -296,7 +296,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag without namespace' => [
 				'<usescript src="UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -306,7 +306,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Tag with empty page' => [
 				'<usescript src="MediaWiki:UseResourceTest2.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[1] ]
 					];
@@ -315,7 +315,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Two tags' => [
 				'<usescript src="MediaWiki:UseResourceTest.js" /><usescript src="MediaWiki:UseResourceTest3.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0], $ids[2] ],
 						'js' => '!function(){console.log(7)}();!function(){alert(8)}();'
@@ -325,7 +325,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Two of the same tag'  => [
 				'<usescript src="MediaWiki:UseResourceTest.js" /><usescript src="MediaWiki:UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -335,7 +335,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Only a usestyle tag' => [
 				'<usestyle src="MediaWiki:UseResourceTest.css" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[3] ],
 						'css' => '*{color:red}'
@@ -345,7 +345,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Only a usescript tag' => [
 				'<usescript src="MediaWiki:UseResourceTest.js" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0] ],
 						'js' => '!function(){console.log(7)}();'
@@ -355,7 +355,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
 			'Both usestyle and usescript tags'  => [
 				'<usescript src="MediaWiki:UseResourceTest.js" /><usestyle src="MediaWiki:UseResourceTest.css" />',
 				'<div class="mw-parser-output"></div>',
-				function ( $ids ) {
+				static function ( $ids ) {
 					return [
 						'pages' => [ $ids[0], $ids[3] ],
 						'js' => '!function(){console.log(7)}();',
-- 
2.20.1

composer dependencies

Development dependencies

npm dependencies

Development dependencies

Logs

Source code is licensed under the AGPL.