Skip to content

Conversation

@arthurkirkosa
Copy link
Collaborator

No description provided.

@arthurkirkosa arthurkirkosa requested a review from binaryk July 1, 2025 07:03
@what-the-diff
Copy link

what-the-diff bot commented Jul 1, 2025

PR Summary

  • Updated Conditional Logic in Filter Method
    The coding logic in the filtering function has been revised to better handle scenarios where the item we're checking is set to 'false'. This improvement makes the function more reliable, meaning it can deal more effectively with different types of input data.

@binaryk binaryk merged commit 3b1a54b into 9.x Jul 1, 2025
1 of 49 checks passed
@binaryk binaryk requested a review from Copilot July 1, 2025 11:42
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 updates the boolean match filter to correctly handle literal false values, ensuring boolean false is treated like the string cases.

  • Adds a strict check for PHP boolean false in the filter logic
  • Minor formatting adjustment (blank line)
Comments suppressed due to low confidence (1)

case RestifySearchable::MATCH_BOOL:
case 'boolean':
if ($value === 'false' || $value === '0') {
if ($value === false || $value === 'false' || $value === '0') {
Copy link

Copilot AI Jul 1, 2025

Choose a reason for hiding this comment

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

Consider normalizing the incoming value using filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) or a dedicated coercion helper to centralize boolean parsing logic instead of manual literal checks.

Suggested change
if ($value === false || $value === 'false' || $value === '0') {
$normalizedValue = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if ($normalizedValue === false) {

Copilot uses AI. Check for mistakes.
@arthurkirkosa arthurkirkosa deleted the fix-matches2 branch December 2, 2025 19:18
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.

3 participants