Skip to content

Add support for operator-only conditions - #203

Draft
Levdbas wants to merge 1 commit into
StoutLogic:masterfrom
Levdbas:feat-single-operator
Draft

Levdbas wants to merge 1 commit into
StoutLogic:masterfrom
Levdbas:feat-single-operator

Conversation

@Levdbas

@Levdbas Levdbas commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Add Support for Operator-Only Conditions

This pull request recreates the functionality proposed in the closed PR #187.

Thank you to the original author, @nlemoine.

Changes

  • Allow field conditional rules to omit value for single-operator conditions such as !=empty.
  • Support the same operator-only form when chaining fluent and() and or() calls.
  • Omit the value key entirely when no value is supplied, matching ACF's expected configuration format.
  • Keep location rules value-required and throw a clear InvalidArgumentException when one is omitted.

Validation

  • ConditionalBuilderTest passes, including operator-only constructor and fluent-chain coverage.
  • LocationBuilderTest passes, including required-value coverage.
  • PHP syntax and whitespace checks pass.
  • The full suite has one unrelated PHPUnit 10 compatibility error in ParentDelegationBuilderTest: MockBuilder::setMethods() has been removed.

@Levdbas Levdbas mentioned this pull request Sep 11, 2026
@Levdbas
Levdbas marked this pull request as draft September 11, 2026 20:08
@Levdbas

Levdbas commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Waiting for #202 to be merged in

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.

1 participant