Skip to content

Conversation

@shakaran
Copy link
Contributor

Improves #206 adding the missing tests required

@garak garak requested a review from Copilot June 26, 2025 12:47

This comment was marked as outdated.

Copy link
Collaborator

@garak garak left a comment

Choose a reason for hiding this comment

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

Please apply suggestions given by copilot

@shakaran
Copy link
Contributor Author

Please apply suggestions given by copilot

it breaks the tests if I apply that since It will be wrong typed

@shakaran shakaran requested review from Copilot and garak June 26, 2025 13:11

This comment was marked as outdated.

@shakaran shakaran requested a review from Copilot June 26, 2025 13:13
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

Enhance the WhereWalker to support nested ConditionalTerm nodes and add tests for complex and simple filter scenarios in WHERE AST traversal.

  • Extend primaryContainsFilter to detect filter expressions within ConditionalTerm nodes
  • Add unit tests covering complex ConditionalTerm combinations and single-factor filters
  • Ensure existing filter logic remains intact with additional assertions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/Test/Pager/Event/Subscriber/Filtration/Doctrine/ORM/Query/WhereWalkerTest.php Add tests for complex conditional terms and simple conditional factors in WHERE clauses
src/Knp/Component/Pager/Event/Subscriber/Filtration/Doctrine/ORM/Query/WhereWalker.php Update primaryContainsFilter to handle ConditionalTerm branches alongside ConditionalExpression
Comments suppressed due to low confidence (2)

src/Knp/Component/Pager/Event/Subscriber/Filtration/Doctrine/ORM/Query/WhereWalker.php:226

  • The newly added ConditionalTerm branch is not exercised by current tests. Add a test that triggers termContainsFilter() to verify correct handling of this case.
            } elseif ($node->conditionalExpression instanceof ConditionalTerm) {

src/Knp/Component/Pager/Event/Subscriber/Filtration/Doctrine/ORM/Query/WhereWalker.php:224

  • The ConditionalTerm branch may never be reached because conditionalExpression is always a ConditionalExpression. Consider refactoring to traverse the expression's terms and invoke termContainsFilter() where appropriate.
           if ($node->conditionalExpression instanceof ConditionalExpression) {

@garak garak merged commit bb8e028 into KnpLabs:master Jun 27, 2025
7 checks passed
@shakaran shakaran deleted the feat/comples-where-statements branch June 27, 2025 10:11
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