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

FEATURE: Fusion match object #3321

Merged
merged 3 commits into from
Apr 6, 2021
Merged

Conversation

Sebobo
Copy link
Member

@Sebobo Sebobo commented Mar 24, 2021

This change adds a new Fusion object to replace many situations where the Case object was used just to return a value based on a string.

The idea is based on the new match method in PHP 8 https://www.php.net/manual/tr/control-structures.match.php.

Resolves: #3318

What I did

Added a new Fusion object that returns the value for a key that matches the given subject or optionally a default if no match was found.

How to verify it

Run included tests.

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch

This change adds a new Fusion object to
replace many situations where the Case object
was used just to return a value based on a string.

The idea is based on the new match method in PHP 8.

Resolves: neos#3318
Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 by reading. nice feature!

@Sebobo Sebobo merged commit 4dbc554 into neos:master Apr 6, 2021
@Sebobo Sebobo deleted the feature/fusion-match branch April 6, 2021 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Fusion.Match in the Neos core
4 participants