Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Config] AddifFalse()
#59325
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Config] AddifFalse()
#59325
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Lil typo in commit message 🫣
Thanks@OskarStark!
1282513
toc99791a
Compare
Fixed, thanks |
c99791a
to4eec7fb
CompareSome broken tests looks related (8.2 low-deps for instance). |
072fec2
to17125b9
Compare
Indeed, fixed and rebased, thanks |
Thank you@OskarStark. |
348781c
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
…sure based checks (arjenm)This PR was squashed before being merged into the 7.3 branch.Discussion----------[Config] Make ifFalse() consistent between value and closure based checks| Q | A| ------------- | ---| Branch? | 7.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues |Fix#59325| License | MITI noticed the Config/ExpBuilder got a nice new ifFalse in Symfony 7.3.But I think its implementation is confusing.The behavior for `ifTrue()` was:- If no closure is provided: if the actual value is `true` execute the then part- If a closure is provided: if it returns `true` execute the then partThe behavior for `ifFalse()` is prior to this PR is:- If no closure is provided: if the actual value is `false` execute the then part- If a closure is provided: if it returns **`true`** execute the then partWith this PR it becomes:- If no closure is provided: if the actual value is `false` execute the then part- If a closure is provided: if it returns **`false`** execute the then partRationale, I think people (me included) would not expect these to be both be valid or invalid with the same input:`$expr->ifTrue(self::valueIsNotValid(...))->thenInvalid()``$expr->ifFalse(self::valueIsNotValid(...))->thenInvalid()`They/I expect to have to change it to a test for valid values (rather than invalid ones):`$expr->ifFalse(self::valueIsValid(...))->thenInvalid()`Commits-------335bdbe [Config] Make ifFalse() consistent between value and closure based checks
Spottet while working on
false
for "no tools" php-llm/llm-chain-bundle#55It is much easier to use like IMHO: