Skip to content

fix: PHP 8.4 nullable exception constructors#775

Closed
colinbird wants to merge 1 commit into
mainfrom
fix/php-8.4-exception-nullable
Closed

fix: PHP 8.4 nullable exception constructors#775
colinbird wants to merge 1 commit into
mainfrom
fix/php-8.4-exception-nullable

Conversation

@colinbird
Copy link
Copy Markdown

@colinbird colinbird commented Jun 4, 2026

Summary

  • Mark $previous as ?Exception on five SDK exception constructors to silence PHP 8.4 implicit-nullable deprecations.
  • Update sdk-generator/templates/static/src/Exception/DataValidationException.php.handlebars so regen keeps the fix (rebilly-php-specific; other exceptions come from @bundled/php in @rebilly/regenerator, already fixed in regenerator 0.0.7+).

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>
@colinbird colinbird requested a review from a team as a code owner June 4, 2026 14:42
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 4, 2026

🦋 Changeset detected

Latest commit: da0d08b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rebilly/client-php Patch

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

🔍 PHP SDK Changes Preview

Diff 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
Commit: da0d08b7691394fac7f0773b39b62c8ef78343db

@colinbird colinbird requested a review from Copilot June 4, 2026 15:05
@colinbird colinbird requested a review from a team June 4, 2026 15:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 $previous as ?Exception to silence PHP 8.4 deprecation notices.
  • Update the DataValidationException SDK-generator template so regenerated code retains the nullable $previous fix.
  • 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.

Comment thread src/Exception/HttpException.php
Comment thread src/Exception/NotFoundException.php
Comment thread src/Exception/GoneException.php
Comment thread src/Exception/TooManyRequestsException.php
Comment thread src/Exception/DataValidationException.php
@colinbird colinbird closed this Jun 4, 2026
@colinbird
Copy link
Copy Markdown
Author

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.

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.

3 participants