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

TASK: Cleanup EventNormalizer #5016

Merged
merged 2 commits into from May 1, 2024
Merged

Conversation

bwaidelich
Copy link
Member

Add EventNormalizer::normalize() and make getEventData() and getEventType() private

Add `EventNormalizer::normalize()` and make `getEventData()` and `getEventType()` private
$this->eventNormalizer->getEventType($event)->value,
json_decode($this->eventNormalizer->getEventData($event)->value, true),
[]
$normalizedEvent->id->value,
Copy link
Member

Choose a reason for hiding this comment

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

i guess this is a functional change as in that we now have stable ids in the export.

Probably a good idea so we have less diff if exporting twice and having the export in version control like the Neos.Demo

Copy link
Member Author

Choose a reason for hiding this comment

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

It's the same as before (I think). The normalizer will create the id (unless its a decorated event that already has one)

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Ah i see you're right a bit sneaky i see ^^ (We are sure at that time that its not a decorated event ... thats why it works)

Copy link
Member

Choose a reason for hiding this comment

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

Okay in that case i guess its a bit weird that normalise is not pure and will return different results on succeeding calls. But the behaviour is not new and required already at other places (we just seem to share the code here now)

So 👍 feel free to merge this ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Even if it was and even if it would specify the id it would work as long as the id is unique

Copy link
Member

@mhsdesign mhsdesign left a comment

Choose a reason for hiding this comment

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

Looks good, but id like to mark this as a TASK as the release notes for the next beta would otherwise confusing. What is here to gain for the end user. Its a nice refactoring for us imo.

@bwaidelich bwaidelich changed the title FEATURE: Cleanup EventNormalizer TASK: Cleanup EventNormalizer Apr 30, 2024
@github-actions github-actions bot added the Task label Apr 30, 2024
Copy link
Contributor

@dlubitz dlubitz left a comment

Choose a reason for hiding this comment

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

Looks good to me! 👍

$this->eventNormalizer->getEventType($event)->value,
json_decode($this->eventNormalizer->getEventData($event)->value, true),
[]
$normalizedEvent->id->value,
Copy link
Contributor

Choose a reason for hiding this comment

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

@bwaidelich bwaidelich merged commit ac2e2f4 into 9.0 May 1, 2024
11 checks passed
@bwaidelich bwaidelich deleted the feature/extend-event-normalizer branch May 1, 2024 07:55
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.

None yet

3 participants