Skip to content

Align phpcs-sniffs with root composer#1166

Merged
davidperezgar merged 2 commits intotrunkfrom
fix-dependencies
Feb 10, 2026
Merged

Align phpcs-sniffs with root composer#1166
davidperezgar merged 2 commits intotrunkfrom
fix-dependencies

Conversation

@ernilambar
Copy link
Member

@ernilambar ernilambar commented Jan 30, 2026

In this PR:

  • Treat root composer.json as the source of truth for dependencies in phpcs-sniffs.
  • Resolve PHP 8.2+ failure in phpcs-sniffs tests caused by token-type conflict between PHP_CodeSniffer and nikic/php-parser.

Changes:

  • Aligned with root: Same constraints for overlapping packages: php >=7.4, config.platform.php 7.4, wp-coding-standards/wpcs ^3.2.0, slevomat/coding-standard ^8.18, phpunit/phpunit ^9.0, dealerdirect/phpcodesniffer-composer-installer ^1.0.0.
  • phpcompatibility: Bumped to ^10.0; set minimum-stability: alpha so 10.0.0-alpha2 can install (root stays on dev-develop due to wp-cli-tests). We could also fix this after new WP-CLI is released.
  • Fix: In phpcs-sniffs/Tests/bootstrap.php, load nikic/php-parser’s compatibility_tokens.php before the PHPCS autoloader so token constants are defined as int and PHPCS does not override them.
  • Note: This workaround in bootstrap can be removed after minimum PHP and packages are upgraded to versions that resolve the conflict.
@ernilambar ernilambar force-pushed the fix-dependencies branch 7 times, most recently from e6e3e33 to 84fd9d7 Compare January 30, 2026 06:34
@ernilambar ernilambar changed the title Update dependencies in sniffs package Jan 30, 2026
@ernilambar ernilambar marked this pull request as ready for review January 30, 2026 06:50
@github-actions
Copy link

github-actions bot commented Jan 30, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ernilambar <nilambar@git.wordpress.org>
Co-authored-by: davidperezgar <davidperez@git.wordpress.org>
Co-authored-by: frantorres <frantorres@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@davidperezgar davidperezgar merged commit ba192b4 into trunk Feb 10, 2026
25 checks passed
@davidperezgar davidperezgar deleted the fix-dependencies branch February 10, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants