fix: PHP 8.4 nullable exception constructors#775
Conversation
PHP 8.4 deprecates implicit nullable parameters on SDK exception constructors. Update rebilly-php-specific DataValidationException template so regeneration keeps the fix. Closes Rebilly/rebilly#20410 Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: da0d08b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🔍 PHP SDK Changes PreviewDiff is too large to display inline 📦 Download the rebilly-sdk-diff artifact from the workflow run for a formatted HTML diff. Updated: 2026-06-04 14:42:49 UTC |
There was a problem hiding this comment.
Pull request overview
This PR addresses PHP 8.4 “implicit nullable parameter” deprecations by updating SDK exception constructors so the $previous parameter is explicitly nullable, and ensures the SDK generator template for DataValidationException preserves the change on regeneration.
Changes:
- Update five exception constructors to type
$previousas?Exceptionto silence PHP 8.4 deprecation notices. - Update the
DataValidationExceptionSDK-generator template so regenerated code retains the nullable$previousfix. - Add a changeset to publish a patch release of
@rebilly/client-php.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Exception/TooManyRequestsException.php | Marks $previous as explicitly nullable in constructor. |
| src/Exception/NotFoundException.php | Marks $previous as explicitly nullable in constructor. |
| src/Exception/HttpException.php | Marks $previous as explicitly nullable in constructor. |
| src/Exception/GoneException.php | Marks $previous as explicitly nullable in constructor. |
| src/Exception/DataValidationException.php | Marks $previous as explicitly nullable in constructor. |
| sdk-generator/templates/static/src/Exception/DataValidationException.php.handlebars | Keeps the nullable $previous change in regenerated SDKs. |
| .changeset/php84-exception-nullable.md | Declares a patch release describing the PHP 8.4 deprecation fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Closing in favor of @ninjasimon's broader PHP 8.4 work in #773 (exception fixes + regenerator bump + CI 8.3/8.4). Thanks for the overlap — tracking there instead. |
Summary
$previousas?Exceptionon five SDK exception constructors to silence PHP 8.4 implicit-nullable deprecations.sdk-generator/templates/static/src/Exception/DataValidationException.php.handlebarsso regen keeps the fix (rebilly-php-specific; other exceptions come from@bundled/phpin@rebilly/regenerator, already fixed in regenerator0.0.7+).