Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:7.3fromOskarStark:feature/ifFalse
Jan 2, 2025
Merged

Conversation

OskarStark
Copy link
Contributor

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
Issues--
LicenseMIT

Spottet while working on

It is much easier to use like IMHO:

->ifTrue(fn ($v) =>false ===$v)

smnandre, IndraGunawan, and welcoMattic reacted with thumbs up emojichr-hertel reacted with rocket emoji
@carsonbotcarsonbot added this to the7.3 milestoneDec 29, 2024
@carsonbotcarsonbot changed the titleAddifFalse()[Config] AddifFalse()Dec 29, 2024
Copy link
Member

@welcoMatticwelcoMattic left a 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!

@OskarStark
Copy link
ContributorAuthor

Lil typo in commit message 🫣

Fixed, thanks

@fabpot
Copy link
Member

Some broken tests looks related (8.2 low-deps for instance).

@OskarStarkOskarStarkforce-pushed thefeature/ifFalse branch 3 times, most recently from072fec2 to17125b9CompareJanuary 2, 2025 10:00
@OskarStark
Copy link
ContributorAuthor

Some broken tests looks related (8.2 low-deps for instance).

Indeed, fixed and rebased, thanks

GromNaN reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@OskarStark.

@fabpotfabpot merged commit348781c intosymfony:7.3Jan 2, 2025
9 checks passed
@OskarStarkOskarStark deleted the feature/ifFalse branchJanuary 2, 2025 11:56
OskarStark added a commit to OskarStark/symfony that referenced this pull requestJan 2, 2025
nicolas-grekas added a commit that referenced this pull requestMar 21, 2025
…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
@fabpotfabpot mentioned this pull requestMay 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@GromNaNGromNaNGromNaN approved these changes

@welcoMatticwelcoMatticwelcoMattic approved these changes

@derrabusderrabusderrabus approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

6 participants
@OskarStark@fabpot@GromNaN@welcoMattic@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp