Skip to content

Fix deprecation error for null in strtolower() call#836

Open
zambodaniel wants to merge 1 commit intoandersao:masterfrom
zambodaniel:master
Open

Fix deprecation error for null in strtolower() call#836
zambodaniel wants to merge 1 commit intoandersao:masterfrom
zambodaniel:master

Conversation

@zambodaniel
Copy link

This pull request makes a minor adjustment to the apply method in RequestCriteria.php to improve robustness when handling the $searchJoin variable.

  • Improved null safety by using the null coalescing operator (??) when calling strtolower on $searchJoin, preventing potential errors if $searchJoin is null. (src/Prettus/Repository/Criteria/RequestCriteria.php)

Copilot AI review requested due to automatic review settings February 27, 2026 10:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a PHP 8.1+ deprecation warning in the RequestCriteria class by adding null safety when calling strtolower() on the $searchJoin variable. In PHP 8.1 and later, passing null to string functions like strtolower() triggers deprecation warnings that will become fatal errors in PHP 9.0.

Changes:

  • Added null coalescing operator (??) to provide an empty string default when $searchJoin is null before calling strtolower()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants