workos-php
workos-php copied to clipboard
PHP 8.4 Deprecation: Implicitly marking parameter as nullable is deprecated
Steps to Reproduce
- Install WorkOS PHP SDK v4.26.0
- Use PHP 8.4
- Call any WorkOS functionality that triggers the UserManagement class
- 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
Anything needed here to get the issue fixed, where i could help with?