Skip to content

Support PHP 8.5 and PHP 8.6 - #13

Open
craig410 wants to merge 5 commits into
2.0.xfrom
support-php85
Open

craig410 wants to merge 5 commits into
2.0.xfrom
support-php85

Conversation

@craig410

Copy link
Copy Markdown
Member

No description provided.

Utils::jsonDecode is deprecated and will be removed in Guzzle 8,
Drop support for < PHP 8.4

Drop support for PHP <8.4

Support guzzle 8

Bump
@craig410
craig410 requested a review from acoulton November 11, 2026 09:56

@acoulton acoulton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks - couple of small comments

try {
return Utils::jsonDecode((string) $response->getBody(), TRUE);
} catch (InvalidArgumentException $e) {
$data = json_decode((string) $response->getBody(), TRUE, 512, JSON_THROW_ON_ERROR);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd suggest not specifying the depth: param as it's the default, and just specifying flags: JSON_THROW_ON_ERROR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I thought the same, I'll do that


try {
$decoded = Utils::jsonDecode($e->getResponse()->getBody(), TRUE);
$decoded = json_decode((string) $e->getResponse()->getBody(), TRUE, 512, JSON_THROW_ON_ERROR);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same comment on json_decode args here

Comment thread composer.json
"require": {
"guzzlehttp/guzzle": "^7.9.2",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
"guzzlehttp/guzzle": "^7.9.2 || ^8.3",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CI looks like the lowest job is still installing 8.3 - I think possibly because of the dev dependency on guzzlehttp/promises >= 3.1.0?
If we're still going to advertise support for 7.x I think we need a CI job that proves that.

I think loosening the promises dependency should be enough to allow the --prefer-lowest to install 7.x.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ahh ok, I'll need to take a closer look, I think we just drop support for guzzle 7. Loosening the promises dependency then fails on 8.6 lowest because of the Is class name issue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might just need to check the ecosystem - there may be other packages we/people use that are tied to guzzle 8.

If the issue is the 8.6 lowest build, I'd maybe look at the CI matrix/composer install step so that the 8.6 lowest build runs composer update --with=guzzlehttp/promises:^3 or whatever min constraint forces that to an 8.6 compatible version.

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