Skip to content

Facilitate the construction of Filter#28

Merged
calmohallag merged 2 commits intorelease-2.0from
feature/filter-construction-improvement
Jul 3, 2025
Merged

Facilitate the construction of Filter#28
calmohallag merged 2 commits intorelease-2.0from
feature/filter-construction-improvement

Conversation

@calmohallag
Copy link
Copy Markdown
Member

@calmohallag calmohallag commented Jul 3, 2025

Changes

  • refactor: filter form factory improvement
  • refactor: add consistency assertion between operator and value in Filter constructor

Example

Before

Filter::from(
    FilterField::from('external_reference'),
    FilterOperator::from(FilterOperator::EQUAL),
    FilterValue::from($externalReference->value()),
)

Keep

new Filter(
    FilterField::from('external_reference'),
    FilterOperator::from(FilterOperator::EQUAL),
    FilterValue::from($externalReference->value()),
)

After

Filter::from(
    'external_reference',
    FilterOperator::EQUAL,
    $externalReference->value(),
)

Migration

  • Option 1: Replace Filter::from( to new Filter(
  • Option 2: Remove all Value Object instantiations during filter construction

@calmohallag calmohallag merged commit 490ce90 into release-2.0 Jul 3, 2025
@calmohallag calmohallag mentioned this pull request Jul 3, 2025
@calmohallag calmohallag deleted the feature/filter-construction-improvement branch March 16, 2026 09:04
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.

2 participants