From 2c9a910581daa74ac41261a5afc750a6f6d3c9d2 Mon Sep 17 00:00:00 2001 From: iitenkida7 Date: Tue, 9 Jun 2026 16:48:16 +0000 Subject: [PATCH 1/2] Cast Content-Length header value to string to avoid psr7 deprecation guzzlehttp/psr7 2.11 deprecates passing a non-string to MessageInterface::withHeader(), and 3.0 will require string|string[]. mb_strlen() returns an int, so every request with a body emits: Passing int to MessageInterface::withHeader() is deprecated; guzzlehttp/psr7 3.0 requires string|string[]. Cast the value to string to silence the deprecation and stay forward-compatible with psr7 3.0. --- CHANGELOG.md | 1 + src/Clients/Http.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 479b7c9e..0b54e67a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +- [Patch] Cast `Content-Length` header value to `string` in `Http::request()` to avoid a `guzzlehttp/psr7` 2.11 deprecation (`Passing int to MessageInterface::withHeader() is deprecated`) and stay compatible with `guzzlehttp/psr7` 3.0 ## v6.1.1 - 2026-03-02 - [#456](https://github.com/Shopify/shopify-api-php/pull/456) [Patch] Update firebase/php-jwt to ^7.0 to address security vulnerability (GHSA-2x45-7fc3-mxwq) diff --git a/src/Clients/Http.php b/src/Clients/Http.php index 4f03ab61..292661f1 100644 --- a/src/Clients/Http.php +++ b/src/Clients/Http.php @@ -207,7 +207,7 @@ protected function request( $request = $request ->withBody($stream) ->withHeader(HttpHeaders::CONTENT_TYPE, $dataType) - ->withHeader(HttpHeaders::CONTENT_LENGTH, mb_strlen($bodyString)); + ->withHeader(HttpHeaders::CONTENT_LENGTH, (string) mb_strlen($bodyString)); } $currentTries = 0; From 6c85557c7a463584816e41f3ebd15f1e9abfcbcb Mon Sep 17 00:00:00 2001 From: iitenkida7 Date: Tue, 9 Jun 2026 16:53:09 +0000 Subject: [PATCH 2/2] Add PR link to changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b54e67a..f9ca9cab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased -- [Patch] Cast `Content-Length` header value to `string` in `Http::request()` to avoid a `guzzlehttp/psr7` 2.11 deprecation (`Passing int to MessageInterface::withHeader() is deprecated`) and stay compatible with `guzzlehttp/psr7` 3.0 +- [#465](https://github.com/Shopify/shopify-api-php/pull/465) [Patch] Cast `Content-Length` header value to `string` in `Http::request()` to avoid a `guzzlehttp/psr7` 2.11 deprecation (`Passing int to MessageInterface::withHeader() is deprecated`) and stay compatible with `guzzlehttp/psr7` 3.0 ## v6.1.1 - 2026-03-02 - [#456](https://github.com/Shopify/shopify-api-php/pull/456) [Patch] Update firebase/php-jwt to ^7.0 to address security vulnerability (GHSA-2x45-7fc3-mxwq)