Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Not expression #394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hgraca
Copy link
Contributor

@hgraca hgraca commented Jul 26, 2023

This will reduce the amount of expressions needed
and allow for complex expressions (within an OR
or an AND) to be negated.

@fain182
Copy link
Collaborator

fain182 commented Aug 5, 2023

We already tried this, it would be nice because we could remove some rules, but the error messages are much less readable.
I think we should prioritize DX over our code simplicity...

@hgraca
Copy link
Contributor Author

hgraca commented Aug 5, 2023

I understand, however, it's not just your code, it's also the code of the developers using this library.

  1. There are rules that are specific to a project, and not really useful anywhere else, and developers could build just the positive version and negate it using the Not provided by the library;

  2. There are complex and dynamic rules that we can't build if we don't have the Not, for example, the PR that you liked is not possible, or at least not elegantly, done without this.

  3. From what I understand, your reservation is not about the rule, but about the feedback when it fails, so I would say it's a different issue to tackle, maybe for boolean expressions we should have a different way of composing the error message? I feel that must NOT (HappyIsland should be an interface) because we want to add this rule for our software is acceptable feedback for a developer to read as a tradeoff for using this expression, and it doesn't stop anyone from building specific NotFooBar expressions.

This will reduce the amount of expressions needed
and allow for complex expressions (within an OR
or an AND) to be negated.
@codecov-commenter
Copy link

Codecov Report

Merging #394 (060d6fb) into main (976c200) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff              @@
##               main     #394      +/-   ##
============================================
+ Coverage     94.33%   94.37%   +0.04%     
- Complexity      571      575       +4     
============================================
  Files            67       68       +1     
  Lines          1500     1512      +12     
============================================
+ Hits           1415     1427      +12     
  Misses           85       85              
Files Changed Coverage Δ
src/Expression/Boolean/Not.php 100.00% <100.00%> (ø)

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