Problem/Motivation
Drupal 9 requires Guzzle 6. Guzzle 6 now is in security support only. In particular, they are not adding compliance with PHP 8.1 to Guzzle 6, which creates issues for Drupal 9's own PHP 8.1 compatibility.
Guzzle 7 includes breaking changes from Guzzle 6, so we should not force sites to update to Guzzle 7 until the next major release (D10). However, we could also allow sites that want to use Guzzle 7 and PHP 8.1 to do so.
Even though we've managed to make Drupal 9 not trigger any deprecations from Guzzle 6 or skip some, there are other deprecations that Guzzle 6 will trigger when it's used by contrib projects. Such deprecations are not user deprecations but they are language level deprecations. For example:
Return type of GuzzleHttp\Command\Command::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Sites exposing this error cannot update to PHP 8.1, so they cannot prepare for Drupal 10.
Proposed resolution
- Consider changing our Guzzle constraint to:
"guzzlehttp/guzzle": "^6.5.2 || ^7.4.1"
-
Keep
core-recommended
and the composer.lock
for tarballs pinned to the Guzzle 6 version.
Ensure HEAD remains compatible with Guzzle 7 with
#3104353: Upgrade to Guzzle 7 →
.
Remaining tasks
User interface changes
N/A
API changes
Not in core itself.
Data model changes
N/A
Release notes snippet
Sites are able to install Guzzle 7 due to a widening of Drupal core's composer constraints. This allows for more complete PHP 8.1 support.