Skip to content

Fix composer PHPCS dependency conflict#22

Closed
sejas wants to merge 1 commit intomainfrom
fix/composer-phpcs-dependency-conflict
Closed

Fix composer PHPCS dependency conflict#22
sejas wants to merge 1 commit intomainfrom
fix/composer-phpcs-dependency-conflict

Conversation

@sejas
Copy link
Member

@sejas sejas commented Feb 24, 2026

Summary

I found the CI was failing when I created a PR that only updated AGENTS.md, so I decided to fix the CI in a separate PR.

  • Upgrades wp-cli/wp-cli-tests from ^4.3.2 to ^5.0 to resolve the PHPCS version conflict
  • Removes explicit phpcompatibility/php-compatibility dependency (now pulled in transitively by wp-cli-tests v5 as ^10.0)
  • Adds minimum-stability: dev + prefer-stable: true since PHPCompatibility 10.x is still in alpha and WPCS is on dev-develop

Context

CI was failing because phpcompatibility/php-compatibility dev-develop moved to squizlabs/php_codesniffer ^4.0.1, which conflicts with wp-coding-standards/wpcs ^3 requiring ^3.x. These two packages need different major versions of php_codesniffer, making them mutually exclusive.

Test plan

  • CI passes (composer install resolves without conflicts)
  • Lint, PHPCS, and Behat tests still pass

🤖 Generated with Claude Code

@sejas sejas force-pushed the fix/composer-phpcs-dependency-conflict branch from 851664d to 0ff92e7 Compare February 24, 2026 10:51
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcompatibility/php-compatibility dev-develop moved to squizlabs/php_codesniffer ^4.0.1,
which conflicts with wp-coding-standards/wpcs ^3 requiring ^3.x. Upgrading wp-cli-tests
to ^5.0 resolves this by aligning all PHPCS-related dependencies. The explicit
phpcompatibility/php-compatibility requirement is removed since wp-cli-tests v5 pulls it
in transitively as ^10.0.

Also adds phpstan/extension-installer to allow-plugins and configures PHPStan with a
baseline for existing errors, as required by wp-cli-tests v5 which added PHPStan support
(matching wp-cli/wp-cli upstream config).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sejas sejas self-assigned this Feb 24, 2026
@sejas sejas force-pushed the fix/composer-phpcs-dependency-conflict branch from 0ff92e7 to 6f066d0 Compare February 24, 2026 10:58
@sejas sejas requested a review from a team February 24, 2026 11:18
@sejas sejas marked this pull request as ready for review February 24, 2026 11:18
@ivan-ottinger
Copy link

ivan-ottinger commented Feb 24, 2026

Hey @sejas 👋🏼 🙂 I have noticed that @JanJakes has opened a related PR: #21.


Edit: @anaemnesis apologies - I have tagged you here initially. That was autocomplete error.

@sejas sejas closed this Feb 24, 2026
@sejas
Copy link
Member Author

sejas commented Feb 24, 2026

@ivan-ottinger , thanks for pointing it out. I've closed my PR in favor of Jan's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants