From 12719da88445cfab25965de09481e2d54b15ad0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jake=C5=A1?= Date: Tue, 24 Feb 2026 09:43:55 +0100 Subject: [PATCH] Upgrade wp-cli-tests to v5 The dev-develop branch of phpcompatibility/php-compatibility now requires squizlabs/php_codesniffer ^4, which conflicts with the ^3 required by wp-cli-tests v4. Additionally, the shared CI workflow (wp-cli/.github#208) now runs code coverage on PHP 8.5, which needs the newer php-code-coverage library from v5. Changes: - Upgrade wp-cli/wp-cli-tests from ^4.3.2 to ^5.0. - Add phpcompatibility/php-compatibility ^10.0@alpha and wp-coding-standards/wpcs @dev to satisfy transitive deps that lack stable releases. - Add phpstan script and config, required by wp-cli-tests v5. - Add stubs for WP_SQLite_Driver, WP_SQLite_Translator, and WP_SQLite_Connection (loaded at runtime by WordPress, not available via Composer). - Allow phpstan/extension-installer Composer plugin. --- composer.json | 9 ++++++--- phpstan.neon.dist | 15 +++++++++++++++ phpstan/stubs.php | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 phpstan.neon.dist create mode 100644 phpstan/stubs.php diff --git a/composer.json b/composer.json index c86ff1e..e7ec2bd 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,9 @@ "wp-cli/wp-cli": "^2.5" }, "require-dev": { - "wp-cli/wp-cli-tests": "^4.3.2", - "phpcompatibility/php-compatibility": "dev-develop" + "wp-cli/wp-cli-tests": "^5.0", + "phpcompatibility/php-compatibility": "^10.0@alpha", + "wp-coding-standards/wpcs": "@dev" }, "scripts": { "behat": "run-behat-tests", @@ -37,6 +38,7 @@ "lint": "run-linter-tests", "phpcs": "run-phpcs-tests", "phpcbf": "run-phpcbf-cleanup", + "phpstan": "run-phpstan-tests", "phpunit": "run-php-unit-tests", "prepare-tests": "install-package-tests", "test": [ @@ -48,7 +50,8 @@ }, "config": { "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true } } } diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..cc19b7f --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,15 @@ +parameters: + level: 0 + paths: + - src + - command.php + scanDirectories: + - vendor/wp-cli/wp-cli/php + scanFiles: + - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php + - phpstan/stubs.php + treatPhpDocTypesAsCertain: false + dynamicConstantNames: + - WP_DEBUG + - WP_DEBUG_LOG + - WP_DEBUG_DISPLAY diff --git a/phpstan/stubs.php b/phpstan/stubs.php new file mode 100644 index 0000000..1c4098f --- /dev/null +++ b/phpstan/stubs.php @@ -0,0 +1,33 @@ +