[codex] Fix getEnv nullable default deprecation#55
Merged
ChiragAgg5k merged 1 commit intomainfrom Mar 28, 2026
Merged
Conversation
Greptile SummaryThis PR makes a clean, targeted fix to remove the PHP implicitly-nullable-parameter deprecation in
Confidence Score: 5/5Safe to merge — the change is minimal, backwards-compatible, and correctly addresses the PHP deprecation. All four changed files contain only correct, low-risk modifications: a one-character type-hint fix in the source, an improved test, and cosmetic composer reordering. No logic changes, no version bumps, no breaking changes. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Fix getEnv nullable default deprecation" | Re-trigger Greptile |
eldadfux
approved these changes
Mar 28, 2026
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
Platform::getEnv()use an explicit nullable type for the optional default valuenulldefaults without relying on a fixedargccomposer.jsonandcomposer.lockmetadata changes in the PRWhy
PHP now deprecates implicitly nullable parameters such as
string $default = null. This change removes the deprecation atPlatform::getEnv()and keeps the test stable across different runtime environments.Impact
Consumers no longer hit the deprecation notice from
Platform::getEnv()on newer PHP versions, and the test now checks behavior rather than shell-specific argument counts.Validation
php -l src/Platform/Platform.phpphp -l tests/unit/GetEnvTest.phpvendor/bin/phpunit --configuration phpunit.xml --filter GetEnvTestRoot Cause
Platform::getEnv()declaredstring $default = null, which relies on implicit nullability that is deprecated in newer PHP versions.