Skip to content

Simplify FilterInterface and FilterHandlerInterface#165

Merged
vjik merged 9 commits intomasterfrom
remove-criteria-array
Mar 2, 2024
Merged

Simplify FilterInterface and FilterHandlerInterface#165
vjik merged 9 commits intomasterfrom
remove-criteria-array

Conversation

@vjik
Copy link
Member

@vjik vjik commented Feb 24, 2024

Q A
Is bugfix?
New feature?
Breaks BC? ✔️
Fixed issues -

@codecov
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (f0feee5) to head (805cbec).

Additional details and impacted files
@@             Coverage Diff              @@
##              master      #165    +/-   ##
============================================
  Coverage     100.00%   100.00%            
+ Complexity       275       236    -39     
============================================
  Files             36        26    -10     
  Lines            701       597   -104     
============================================
- Hits             701       597   -104     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@what-the-diff
Copy link

what-the-diff bot commented Feb 24, 2024

PR Summary

  • Remodeled the filter interface
    The ‘FilterInterface’ has been simplified, with the removal of the getOperator() and toCriteriaArray() methods. This simplification also extended to all implementations of the interface and will make it more straightforward to use.

  • Enhanced coding efficiency with PHP 8 constructor property promotion
    The code now takes advantage of PHP 8 constructor property promotion for better efficiency in property assignment throughout all filter classes. This makes the code cleaner and easier to read.

  • Refined filter handler classes
    The AllHandler, AnyHandler, and BetweenHandler classes were revised to implement the IterableFilterHandlerInterface interface, thus allowing them to be used with iterable filters. This will improve their flexibility and expand their range of usage.

  • Updates to various handler and interface classes
    Several classes were updated to use the Yiisoft\Arrays\ArrayHelper utility and the FilterInterface. These changes should enhance performance and maintainability of code.

  • Removal of unnecessary classes
    The PR includes the removal of several classes such as CompareHandler and FilterAssert, which were no longer necessary due to changes in the rest of the codebase. This cleanup contributes to making the code more concise and reduces complexity.

  • Restructure of testing suite
    Several test files were removed or modified, adding more relevance to the tests and discarding redundant ones. New test methods were added to several classes to increase their coverage. This will provide improved confidence in the correctness and robustness of the system.

  • Custom filter improvements
    Custom filters received various improvements, including the removal of unused methods and better matching capability of filter handlers, driving up their functionality.

Overall, these changes increase the efficiency of our code, simplify our interface, make it easier to implement, and improve the coverage of our tests. This contributes to an overall more robust and maintainable system.

vjik and others added 6 commits February 24, 2024 11:51
# Conflicts:
#	src/Reader/Filter/EqualsEmpty.php
#	src/Reader/Iterable/FilterHandler/EqualsEmptyHandler.php
#	tests/Reader/IterableHandler/EqualsEmptyTest.php
@vjik vjik marked this pull request as ready for review February 25, 2024 15:22
@vjik vjik requested a review from a team February 25, 2024 15:22
@vjik vjik added the status:code review The pull request needs review. label Feb 25, 2024
@vjik vjik merged commit 3c09de4 into master Mar 2, 2024
@vjik vjik deleted the remove-criteria-array branch March 2, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants