Skip to content

Commit

Permalink
Composer: allow composer/installers 2.x (#65356)
Browse files Browse the repository at this point in the history
Composer released the first version of `composer/installers` 2.x over three years ago.

The 2.x range has a minimum PHP version of PHP 7.2.
While WordPress and Gutenberg still supported PHP < 7.2, the requirement could have been set to `^1.0 || ^2.0`, but as support for PHP < 7.2 has now been dropped, I see no reason not to require the package at `^2.0` outright.

Having said that, there may still be other plugins out there which don't allow for the `composer/installers` 2.x package yet and if one such plugins would be installed as a dependency alongside Gutenberg, this would lead to an unresolvable conflict when running `composer install` for such a project.

So with that in mind, I'm erring on the side of caution and propose to change the requirements to `^1.0 || ^2.0`.

Note: this will also get rid of a PHP 8.4 deprecation notice when running various Composer commands.

Refs:
* https://github.com/composer/installers/blob/main/CHANGELOG.md
* https://github.com/composer/installers/releases

Co-authored-by: jrfnl <[email protected]>
Co-authored-by: desrosj <[email protected]>
  • Loading branch information
3 people authored Sep 26, 2024
1 parent dfe58ac commit 9220e7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
],
"require": {
"composer/installers": "~1.0"
"composer/installers": "^1.0 || ^2.0"
},
"scripts": {
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
Expand Down

0 comments on commit 9220e7a

Please sign in to comment.