diff --git a/composer.json b/composer.json index c81afda..762605c 100644 --- a/composer.json +++ b/composer.json @@ -23,9 +23,24 @@ "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.6" }, + "require-dev": { + "cweagans/composer-patches": "^1.7" + }, "minimum-stability": "dev", "prefer-stable": true, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "cweagans/composer-patches": true + } + }, + "extra": { + "enable-patching": true, + "patches": { + "wp-coding-standards/wpcs": { + "Add PHP 8 support until WordPress releases a new version": "patches/PHP-8-ControlStructureSpacing.patch" + } + } } } diff --git a/composer.lock b/composer.lock index 4f63834..a92acd2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,26 +4,26 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a5a067a367893e5df66fd88fc554481b", + "content-hash": "0351d8c3bf0c4ae88d5e99ef97c01cca", "packages": [ { "name": "automattic/vipwpcs", - "version": "2.3.2", + "version": "2.3.3", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "efacebef421334d54b99afa92fb8fa645336a8a7" + "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/efacebef421334d54b99afa92fb8fa645336a8a7", - "reference": "efacebef421334d54b99afa92fb8fa645336a8a7", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", + "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7", "php": ">=5.4", - "sirbrillig/phpcs-variable-analysis": "^2.8.3", + "sirbrillig/phpcs-variable-analysis": "^2.11.1", "squizlabs/php_codesniffer": "^3.5.5", "wp-coding-standards/wpcs": "^2.3" }, @@ -56,31 +56,31 @@ "source": "https://github.com/Automattic/VIP-Coding-Standards", "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2021-04-28T16:41:50+00:00" + "time": "2021-09-29T16:20:23+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { @@ -101,6 +101,10 @@ "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -112,6 +116,7 @@ "codesniffer", "composer", "installer", + "phpcbf", "phpcs", "plugin", "qa", @@ -126,7 +131,7 @@ "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "time": "2020-12-07T18:04:37+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -248,16 +253,16 @@ }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.1", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e" + "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", - "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308", + "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308", "shasum": "" }, "require": { @@ -298,38 +303,37 @@ "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2021-02-15T12:58:46+00:00" + "time": "2021-12-30T16:37:40+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "0.5.4", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9" + "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e352d065af1ae9b41c12d1dfd309e90f7b1f55c9", - "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/dbc093d7af60eff5cd575d2ed761b15ed40bd08e", + "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "phing/phing": "^2.16.3", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.60", - "phpstan/phpstan-strict-rules": "^0.12.5", - "phpunit/phpunit": "^7.5.20", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", "symfony/process": "^5.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.5-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -346,22 +350,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.4" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.2.0" }, - "time": "2021-04-03T14:46:19+00:00" + "time": "2021-09-16T20:46:02+00:00" }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.0", + "version": "v2.11.2", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "e76e816236f401458dd8e16beecab905861b5867" + "reference": "3fad28475bfbdbf8aa5c440f8a8f89824983d85e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/e76e816236f401458dd8e16beecab905861b5867", - "reference": "e76e816236f401458dd8e16beecab905861b5867", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3fad28475bfbdbf8aa5c440f8a8f89824983d85e", + "reference": "3fad28475bfbdbf8aa5c440f8a8f89824983d85e", "shasum": "" }, "require": { @@ -401,41 +405,41 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2021-03-09T22:32:14+00:00" + "time": "2021-07-06T23:45:17+00:00" }, { "name": "slevomat/coding-standard", - "version": "7.0.8", + "version": "7.0.18", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "48141737f9e5ed701ef8bcea2027e701b50bd932" + "reference": "b81ac84f41a4797dc25c8ede1b0718e2a74be0fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/48141737f9e5ed701ef8bcea2027e701b50bd932", - "reference": "48141737f9e5ed701ef8bcea2027e701b50bd932", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/b81ac84f41a4797dc25c8ede1b0718e2a74be0fc", + "reference": "b81ac84f41a4797dc25c8ede1b0718e2a74be0fc", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", "php": "^7.1 || ^8.0", - "phpstan/phpdoc-parser": "0.5.1 - 0.5.4", - "squizlabs/php_codesniffer": "^3.6.0" + "phpstan/phpdoc-parser": "^1.0.0", + "squizlabs/php_codesniffer": "^3.6.1" }, "require-dev": { - "phing/phing": "2.16.4", - "php-parallel-lint/php-parallel-lint": "1.3.0", - "phpstan/phpstan": "0.12.86", - "phpstan/phpstan-deprecation-rules": "0.12.6", - "phpstan/phpstan-phpunit": "0.12.18", - "phpstan/phpstan-strict-rules": "0.12.9", - "phpunit/phpunit": "7.5.20|8.5.5|9.5.4" + "phing/phing": "2.17.0", + "php-parallel-lint/php-parallel-lint": "1.3.1", + "phpstan/phpstan": "1.2.0", + "phpstan/phpstan-deprecation-rules": "1.0.0", + "phpstan/phpstan-phpunit": "1.0.0", + "phpstan/phpstan-strict-rules": "1.1.0", + "phpunit/phpunit": "7.5.20|8.5.21|9.5.10" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-master": "6.x-dev" + "dev-master": "7.x-dev" } }, "autoload": { @@ -450,7 +454,7 @@ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.0.8" + "source": "https://github.com/slevomat/coding-standard/tree/7.0.18" }, "funding": [ { @@ -462,20 +466,20 @@ "type": "tidelift" } ], - "time": "2021-05-10T08:51:20+00:00" + "time": "2021-12-07T17:19:06+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.0", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, "require": { @@ -518,7 +522,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-04-09T00:54:41+00:00" + "time": "2021-12-12T21:44:58+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -572,7 +576,56 @@ "time": "2020-05-13T23:57:56+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "cweagans/composer-patches", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e9969cfc0796e6dea9b4e52f77f18e1065212871", + "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0 || ~2.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "support": { + "issues": "https://github.com/cweagans/composer-patches/issues", + "source": "https://github.com/cweagans/composer-patches/tree/1.7.2" + }, + "time": "2022-01-25T19:21:20+00:00" + } + ], "aliases": [], "minimum-stability": "dev", "stability-flags": [], @@ -582,5 +635,5 @@ "php": "^7.2 || ^8.0" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.2.0" } diff --git a/patches/PHP-8-ControlStructureSpacing.patch b/patches/PHP-8-ControlStructureSpacing.patch new file mode 100644 index 0000000..97dad70 --- /dev/null +++ b/patches/PHP-8-ControlStructureSpacing.patch @@ -0,0 +1,65 @@ +From 7cd46bed1e6a7a2af3fe24c7f4a044da3076d8f4 Mon Sep 17 00:00:00 2001 +From: jrfnl +Date: Mon, 13 Jul 2020 10:16:43 +0200 +Subject: [PATCH] PHP 8 | ControlStructureSpacing: bug fix - $data should be an + array + +The `$data` parameter of the `$phpcsFile->add[Fixable]Error|Warning()` methods is expected to be an array, not a string. + +Without this fix, PHP 8 will throw and (uncaught) `TypeError: vsprintf(): Argument #2 ($args) must be of type array, string given`. +--- + .../Sniffs/WhiteSpace/ControlStructureSpacingSniff.php | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +index 5b7426fc..cbca5fe4 100644 +--- a/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php ++++ b/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +@@ -209,7 +209,7 @@ class ControlStructureSpacingSniff extends Sniff { + $error, + $stackPtr, + 'SpaceBeforeFunctionOpenParenthesis', +- $this->tokens[ ( $function_name_ptr + 1 ) ]['content'] ++ array( $this->tokens[ ( $function_name_ptr + 1 ) ]['content'] ) + ); + + if ( true === $fix ) { +@@ -282,7 +282,7 @@ class ControlStructureSpacingSniff extends Sniff { + $error, + $stackPtr, + 'ExtraSpaceBeforeOpenParenthesis', +- $this->tokens[ ( $stackPtr + 1 ) ]['content'] ++ array( $this->tokens[ ( $stackPtr + 1 ) ]['content'] ) + ); + + if ( true === $fix ) { +@@ -310,7 +310,7 @@ class ControlStructureSpacingSniff extends Sniff { + $error, + $stackPtr, + 'ExtraSpaceAfterOpenParenthesis', +- $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] ++ array( $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] ) + ); + + if ( true === $fix ) { +@@ -341,7 +341,7 @@ class ControlStructureSpacingSniff extends Sniff { + $error, + $stackPtr, + 'ExtraSpaceBeforeCloseParenthesis', +- $this->tokens[ ( $parenthesisCloser - 1 ) ]['content'] ++ array( $this->tokens[ ( $parenthesisCloser - 1 ) ]['content'] ) + ); + + if ( true === $fix ) { +@@ -399,7 +399,7 @@ class ControlStructureSpacingSniff extends Sniff { + $error, + $stackPtr, + 'ExtraSpaceAfterCloseParenthesis', +- $this->tokens[ ( $parenthesisCloser + 1 ) ]['content'] ++ array( $this->tokens[ ( $parenthesisCloser + 1 ) ]['content'] ) + ); + + if ( true === $fix ) { +-- +2.34.1 +