From bcfcc555d780870fdfe6681553b74724651f6f43 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Fri, 4 Aug 2023 14:06:02 -0700 Subject: [PATCH] Improve PHP 8.x linting The PHPCompatibilityWP package is tied to the 9.x release of the PHPCompatibility package. The current 9.3.5 release of PHPCompatibility has not been updated since December 2019 and I believe is missing quite a few updated sniffs for PHP 8.x syntax. See: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.5...develop This labels the PHPCompatibility `develop` branch as a 9.99.99 release, which satisifies the PHPCompatibilityWP requirements and improves scanning for PHP 8.x compatibility. See: https://github.com/PHPCompatibility/PHPCompatibilityWP/issues/40#issuecomment-1139623926 Changes: * `composer config minimum-stability dev` * `composer require --dev phpcompatibility/php-compatibility:"dev-develop as 9.99.99"` * `composer update phpcompatibility/phpcompatibility-wp` --- composer.json | 6 +++-- composer.lock | 70 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index ea09885..0078a87 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ "require-dev": { "squizlabs/php_codesniffer": "3.*", "phpcompatibility/phpcompatibility-wp": "*", - "wp-coding-standards/wpcs": "dev-develop" + "wp-coding-standards/wpcs": "dev-develop", + "phpcompatibility/php-compatibility": "dev-develop as 9.99.99" }, "scripts": { @@ -32,5 +33,6 @@ "composer/*": true, "dealerdirect/phpcodesniffer-composer-installer": true } - } + }, + "minimum-stability": "dev" } diff --git a/composer.lock b/composer.lock index 168b6a0..90ec876 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "51eb7bb6a0e2190e0cb5847ce4725261", + "content-hash": "1ab1301744ec54413738802fe167c252", "packages": [], "packages-dev": [ { @@ -87,33 +87,45 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "version": "dev-develop", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "reference": "1c48ec699aed320682196ad2289647ab4a7f5345" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1c48ec699aed320682196ad2289647ab4a7f5345", + "reference": "1c48ec699aed320682196ad2289647ab4a7f5345", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.5", + "squizlabs/php_codesniffer": "^3.7.1" }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "replace": { + "wimg/php-compatibility": "*" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.3", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.1.0", + "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "default-branch": true, "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev", + "dev-develop": "10.x-dev" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" @@ -139,13 +151,14 @@ "keywords": [ "compatibility", "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2019-12-27T09:44:58+00:00" + "time": "2023-08-04T19:44:27+00:00" }, { "name": "phpcompatibility/phpcompatibility-paragonie", @@ -206,16 +219,16 @@ }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.4", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + "reference": "262f9d81273932315d15d704f69b9d678b939cb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/262f9d81273932315d15d704f69b9d678b939cb3", + "reference": "262f9d81273932315d15d704f69b9d678b939cb3", "shasum": "" }, "require": { @@ -223,12 +236,13 @@ "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -257,7 +271,7 @@ "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2022-10-24T09:00:36+00:00" + "time": "2023-01-05T13:34:27+00:00" }, { "name": "phpcsstandards/phpcsextra", @@ -510,12 +524,20 @@ "time": "2023-07-11T09:36:30+00:00" } ], - "aliases": [], - "minimum-stability": "stable", + "aliases": [ + { + "package": "phpcompatibility/php-compatibility", + "version": "dev-develop", + "alias": "9.99.99", + "alias_normalized": "9.99.99.0" + } + ], + "minimum-stability": "dev", "stability-flags": { - "wp-coding-standards/wpcs": 20 + "wp-coding-standards/wpcs": 20, + "phpcompatibility/php-compatibility": 20 }, - "prefer-stable": true, + "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.4"