workos-php icon indicating copy to clipboard operation
workos-php copied to clipboard

PHP 8.4 Deprecation: Implicitly marking parameter as nullable is deprecated

Open StanBarrows opened this issue 5 months ago • 1 comments

Steps to Reproduce

  1. Install WorkOS PHP SDK v4.26.0
  2. Use PHP 8.4
  3. Call any WorkOS functionality that triggers the UserManagement class
  4. Observe deprecation warnings in logs

Expected Behavior

No deprecation warnings should be emitted when using the SDK with PHP 8.4.

Actual Behavior

Multiple deprecation warnings are shown, indicating that nullable parameters need explicit type declarations.

Root Cause

PHP 8.4 has deprecated implicit nullable parameter declarations. Code like this:

function getLogoutUrl(string $return_to = null) // ❌ Deprecated

Must be changed to:

function getLogoutUrl(?string $return_to = null) // ✅ Explicit nullable

Reference

PHP Deprecated: WorkOS\UserManagement::getLogoutUrl(): Implicitly marking parameter $return_to as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/workos/workos-php/lib/UserManagement.php on line 1279

StanBarrows avatar Jul 26 '25 08:07 StanBarrows

Anything needed here to get the issue fixed, where i could help with?

ItsReddi avatar Sep 22 '25 12:09 ItsReddi