Skip to content

Use strict comparison for filter count validation#666

Closed
Copilot wants to merge 2 commits into
handle-global-filter-in-routesfrom
copilot/sub-pr-661
Closed

Use strict comparison for filter count validation#666
Copilot wants to merge 2 commits into
handle-global-filter-in-routesfrom
copilot/sub-pr-661

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 12, 2025

Addresses code review feedback to use strict comparison (!==) instead of loose comparison (!=) when validating filter counts in HandleGlobalFilters middleware.

Change:

  • src/Http/Middleware/HandleGlobalFilters.php line 21: !=!==
// Before
if ($this->globalFiltersHandler->isEnabled()
    && count($filterKeys) != count($this->globalFiltersHandler->getFilters())
) {

// After
if ($this->globalFiltersHandler->isEnabled()
    && count($filterKeys) !== count($this->globalFiltersHandler->getFilters())
) {

Both count() calls return integers, so behavior is unchanged. Strict comparison provides explicit type safety.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dvlpp <973325+dvlpp@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on global filter handling Use strict comparison for filter count validation Dec 12, 2025
Copilot AI requested a review from dvlpp December 12, 2025 07:52
@dvlpp dvlpp closed this Dec 12, 2025
@aguingand aguingand deleted the copilot/sub-pr-661 branch April 30, 2026 10:39
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