[FSSDK-12610] Fix: PHP 8.4 implicit nullable parameter deprecation warnings#296
Merged
Tamara-Barum merged 3 commits intoMay 20, 2026
Merged
Conversation
…rnings Use explicit nullable types (?Type) instead of implicit nullable (Type $param = null) to resolve deprecation warnings on PHP 8.4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
raju-opti
approved these changes
May 20, 2026
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate PHP 8.4 deprecation warnings caused by implicitly nullable typed parameters by making nullability explicit (Type $x = null → ?Type $x = null) in key SDK constructors.
Changes:
- Updated
Optimizelyconstructor to explicitly mark optional dependencies as nullable. - Updated
HTTPProjectConfigManagerconstructor to explicitly mark optional logger/error handler/notification center as nullable. - Updated
DecisionServiceconstructor to explicitly mark the optional user profile service as nullable.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/Optimizely/Optimizely.php |
Makes optional constructor dependencies explicitly nullable to avoid PHP 8.4 implicit-nullable deprecations. |
src/Optimizely/ProjectConfigManager/HTTPProjectConfigManager.php |
Marks optional logger/error handler/notification center params as nullable for PHP 8.4 compatibility. |
src/Optimizely/DecisionService/DecisionService.php |
Marks optional UserProfileServiceInterface constructor param as nullable for PHP 8.4 compatibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…, VariableTypeUtils, DefaultEventDispatcher, OptimizelyConfigService Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Qwen 3.6 27b had this for a review. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type $param = nullto?Type $param = nullin constructors and methodsnull, this makes the nullable type explicit as PHP 8.4 requiresJira
FSSDK-12610
Related
strlen(null)) and FSSDK-9573 (PHP 8.2 dynamic properties)Files changed
src/Optimizely/Optimizely.php$eventDispatcher,$logger,$errorHandler,$userProfileService,$configManager,$notificationCentersrc/Optimizely/ProjectConfigManager/HTTPProjectConfigManager.php$logger,$errorHandler,$notificationCentersrc/Optimizely/DecisionService/DecisionService.php$userProfileServicesrc/Optimizely/Utils/Validator.php$loggersrc/Optimizely/Utils/VariableTypeUtils.php$loggersrc/Optimizely/Event/Dispatcher/DefaultEventDispatcher.php$httpClientsrc/Optimizely/OptimizelyConfig/OptimizelyConfigService.php$loggerTest plan
composer teston PHP 8.4 to confirm deprecation warnings are gone🤖 Generated with Claude Code