Skip to content

SHOP-8855: PHP 8.5 compatibility updates - #183

Open
deepsidhu1313 wants to merge 5 commits into
masterfrom
SHOP-8855
Open

SHOP-8855: PHP 8.5 compatibility updates#183
deepsidhu1313 wants to merge 5 commits into
masterfrom
SHOP-8855

Conversation

@deepsidhu1313

@deepsidhu1313 deepsidhu1313 commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

SHOP-8855: PHP 8.5 Compatibility Updates

Summary

Updates bold-shopify-toolkit for PHP 8.5 compatibility.

PHP 8.5 Deprecation Fixes

Implicit Nullable Parameters

  • Base::serializeModel()$entity param

Deprecated Guzzle Functions

  • Client::post()\GuzzleHttp\json_encode()\GuzzleHttp\Utils::jsonEncode()
  • Client::put()\GuzzleHttp\json_encode()\GuzzleHttp\Utils::jsonEncode()
  • Client::sendRequestToShopify()\GuzzleHttp\json_decode()\GuzzleHttp\Utils::jsonDecode()

These functions were deprecated in Guzzle 7 and removed in later versions.

Beta Release

8.0.0-beta.4 — available for testing

…ls:: equivalents

\GuzzleHttp\json_encode() and \GuzzleHttp\json_decode() were deprecated
in Guzzle 7 and removed in later versions. Use \GuzzleHttp\Utils::jsonEncode()
and \GuzzleHttp\Utils::jsonDecode() instead.
@deepsidhu1313 deepsidhu1313 changed the title SHOP-8855 : Php 8.4 updates SHOP-8855: PHP 8.5 compatibility updates Jun 22, 2026
ReflectionProperty::setAccessible() has had no effect since PHP 8.1 —
getValue()/setValue() work on private and protected properties without
it — and PHP 8.5 deprecates the call outright:

    Deprecated: Method ReflectionProperty::setAccessible() is
    deprecated since 8.5, as it has no effect since PHP 8.1

unserializeModel() calls it once per property per model, so this was by
far the loudest deprecation in a consuming app's logs: a single admin
page load in product-bundles emitted dozens of these lines, drowning
actual errors in the Apache log.

Removing the call is behaviour-neutral on any supported version.
Verified against product-bundles on PHP 8.5: full unit suite green
(123 tests, 186 assertions), and a direct unserializeModel() of a
Product with private $id/$title still hydrates correctly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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