Skip to content

Fix PHP 8.4 deprecations and Guzzle test compatibility - #657

Merged
lindyhopchris merged 1 commit into
cloudcreativity:build/update-laravel-and-phpfrom
dawgbone:derek_development/php84-compatibility
Nov 27, 2026
Merged

lindyhopchris merged 1 commit into
cloudcreativity:build/update-laravel-and-phpfrom
dawgbone:derek_development/php84-compatibility

Conversation

@dawgbone

Copy link
Copy Markdown
Contributor


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 $meta constructor parameter as ?array.

  • Add the mixed return type to Link::jsonSerialize() to satisfy the JsonSerializable interface.

Both changes preserve existing behavior.

Guzzle PSR-7 compatibility

  • Cast the Content-Length header 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 and json_encode() output.

Testing

Verified using:

Component | Version -- | -- PHP | 8.4.28 Laravel | 13.44.1 PHPUnit | 11.5.58 Orchestra Testbench | 11.3.0

Full 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.php deprecation 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.php concerns 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.

@lindyhopchris lindyhopchris self-assigned this Nov 27, 2026
@lindyhopchris
lindyhopchris changed the base branch from main to build/update-laravel-and-php November 27, 2026 13:11
@lindyhopchris
lindyhopchris merged commit f62e218 into cloudcreativity:build/update-laravel-and-php Nov 27, 2026
6 of 10 checks passed
@lindyhopchris

Copy link
Copy Markdown
Member

@dawgbone thanks for the PR - appreciated. I've tagged this as 7.4.0

@dawgbone

Copy link
Copy Markdown
Contributor Author

Thank you for keeping this maintained for the legacy users.

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