When we try to run composer require --dev pressbooks/coding-standards ^1.0 in a repo which doesn't include them already, we will sometimes get composer conflict errors like the following:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: squizlabs/php_codesniffer[3.3.2, 3.4.0].
- Can only install one of: squizlabs/php_codesniffer[3.3.2, 3.4.0].
- Can only install one of: squizlabs/php_codesniffer[3.3.2, 3.4.0].
- pressbooks/coding-standards 1.0.0 requires squizlabs/php_codesniffer 3.3.2 -> satisfiable by squizlabs/php_codesniffer[3.3.2].
- Installation request for pressbooks/coding-standards ^1.0 -> satisfiable by pressbooks/coding-standards[1.0.0].
- Installation request for squizlabs/php_codesniffer (locked at 3.4.0, required as ^3.3.2) -> satisfiable by squizlabs/php_codesniffer[3.4.0].
The Pressbooks version of coding-standards has not updated its dependencies in a long time: https://github.com/pressbooks/coding-standards/blob/master/composer.json. Ned opened a PR to update/remove dependencies here: https://github.com/pressbooks/coding-standards/pull/9/files
If we accept coding standards changes from these other repos, we'll need to make decisions about several rules that have been updated since we locked the dependencies. See sample output from Pressbooks repo alone: https://github.com/pressbooks/coding-standards/pull/9#issuecomment-790036691
Additional content
php_codesniffer is locked at 3.3.2 (last updated here:https://github.com/pressbooks/coding-standards/commit/b5c9000ef0205f349fbd03cf219ebfac27d17ec5), latest release is 3.5.8: https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.8
humanmade/coding-standards is locked at 0.5.0, latest release is now 1.1.3: https://github.com/humanmade/coding-standards/releases/tag/v1.1.3
phpunit/phpunit is locked at 6.5.14, other of our repos use latest release from v7 of this project
fig-r/psr2r-sniffer is locked at 0.5.0, latest release is 1.0.1: https://github.com/php-fig-rectified/psr2r-sniffer/releases (Ned removed this dependency in his PR)
When we try to run
composer require --dev pressbooks/coding-standards ^1.0
in a repo which doesn't include them already, we will sometimes get composer conflict errors like the following: