Repository navigation
Fix PHP 8.4 deprecations and Guzzle test compatibility - #657
Merged
lindyhopchris merged 1 commit intoNov 27, 2026
Conversation
lindyhopchris
changed the base branch from
main
to
build/update-laravel-and-php
November 27, 2026 13:11
lindyhopchris
merged commit Nov 27, 2026
f62e218
into
cloudcreativity:build/update-laravel-and-php
6 of 10 checks passed
Member
|
@dawgbone thanks for the PR - appreciated. I've tagged this as |
Contributor
Author
|
Thank you for keeping this maintained for the legacy users. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses two PHP 8.4 deprecations in the JSON Link implementation and fixes a test compatibility issue introduced by newer versions of Guzzle PSR-7.
Changes
PHP 8.4 compatibility
Explicitly declare the optional
$metaconstructor parameter as?array.Add the
mixedreturn type toLink::jsonSerialize()to satisfy theJsonSerializableinterface.Both changes preserve existing behavior.
Guzzle PSR-7 compatibility
Cast the
Content-Lengthheader value to a string in the integration test helper.This resolves 43 test errors caused by newer Guzzle PSR-7 versions rejecting integer header values.
Regression coverage
Add tests for link serialization with and without metadata.
Verify both direct
jsonSerialize()results andjson_encode()output.Testing
Verified using:
Component | Version -- | -- PHP | 8.4.28 Laravel | 13.44.1 PHPUnit | 11.5.58 Orchestra Testbench | 11.3.0Full upstream regression suite:
1,222 tests
3,926 assertions
0 failures or errors
Exit code: 0
Additionally verified:
PHP syntax checks pass.
Direct PHP 8.4 execution no longer produces the two identified
Link.phpdeprecation warnings.No whitespace errors.
Existing warnings
The regression suite continues to report:
104 PHPUnit deprecations relating to metadata in PHPDoc comments.
3 skipped tests.
4 incomplete tests.
These counts are unchanged from the passing baseline after correcting the Guzzle test helper.
PHPStan Level 5 reports 152 findings across the existing package source. The finding in
Link.phpconcerns an unreachable statement on line 61, which is present in the original v7.3.0 release and is unrelated to this patch.The changes in this PR are intentionally limited to the identified compatibility issues and their regression coverage.