-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.4 - Fixed implicitly nullable parameter issue in BaseMessage Model #207
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (3)src/Models/BaseMessage.php (3)
The change correctly addresses PHP 8.4's deprecation notice by making the nullable parameter explicit with the
The change correctly addresses PHP 8.4's deprecation notice by making the nullable parameter explicit with the Line range hint Let's ensure we've caught all instances of implicit nullable parameters in the codebase. ✅ Verification successfulBased on the search results, I can now generate a final response: All nullable parameter instances have been properly handled with explicit type hints. The search results show that while there are many functions with null default values in the codebase, the specific instances in 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for other potential instances of implicit nullable parameters
# Pattern: parameter with default null but without explicit nullable type hint
# Look for method parameters with = null but without ? prefix
rg "function.*\([^)]*\s+\$\w+\s*=\s*null[^)]*\)" --type php
# Look for constructor parameters with = null but without ? prefix
rg "__construct.*\([^)]*\s+\$\w+\s*=\s*null[^)]*\)" --type php
# Look for other potential parameter patterns that might need updating
ast-grep --pattern 'function $FNAME($PARAMS) { $$$
}' --lang php
Length of output: 191 Script: #!/bin/bash
# Let's try a different approach to find nullable parameters
# Search for method parameters with null default value
rg "function.*\([^)]*=\s*null" --type php
# Search specifically for CipherParams with null default
rg "CipherParams.*=\s*null" --type php
# Look for function declarations with potential nullable parameters
rg "function.*\([^)]*\)" --type php -A 1
# Use ast-grep to find function declarations with parameters
ast-grep --pattern 'function $NAME($PARAMS = null) { $$$
}' --lang php
Length of output: 69764 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Came back to this after the holidays. It looks like the issue is with PHP 7.x versions. Just wondering if there is a reason those are still being supported? Currently PHP 7.x and PHP 8.0 are EOL and are thus insecure to use. |
Hi @alexscott64 thanks for creating the PR. We will check and get back to you 👍 |
This fixes the deprecation notice for PHP8.4 regarding implicitly nullable parameters.
#206
Summary by CodeRabbit
New Features
Bug Fixes