Skip to content

removes nesting from recorded events - #208

Merged
prolic merged 2 commits into
prooph:developfrom
oqq:improvement/remove_recursion
Nov 7, 2016
Merged

removes nesting from recorded events#208
prolic merged 2 commits into
prooph:developfrom
oqq:improvement/remove_recursion

Conversation

@oqq

@oqq oqq commented Nov 4, 2016

Copy link
Copy Markdown
Member

This PR closes #202

@prolic

prolic commented Nov 4, 2016

Copy link
Copy Markdown
Member

Can you add a test-case that is failing without this?

@codeliner

Copy link
Copy Markdown
Member

@prolic I guess a test-case is difficult here because the test would need to reach xdebugs max nesting function level and therefor xdebug would need to be installed and set up with an appropriate limit.

Comment thread src/EventStore.php Outdated
$this->actionEventEmitter->dispatch($event);

$this->recordedEvents = new ArrayIterator();
$this->resetRecordedEvents();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure if it is worth it, to create a new method for a one line of code? I would prefer $this->recorderEvents = new AppendIterator(). Every function call in PHP is a performance drawback too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@oqq In a domain model I would do it exactly like you: clean and readable code that tells you what it does. But @sandrokeil 's reasoning wins here, because prooph is infrastructure and performance has very high priority.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Of course, my reason was to be consistent what "recordedEvents" should be. But i agree with the performance reasons.

@oqq

oqq commented Nov 7, 2016

Copy link
Copy Markdown
Member Author

It would be possible to implement a hackish test case, which would be skipped if xdebug is not available. But for me it is currently not possible to run xdebug with php7.1

@prolic
prolic merged commit 9b05a82 into prooph:develop Nov 7, 2016
prolic added a commit that referenced this pull request Nov 7, 2016
@prolic

prolic commented Nov 7, 2016

Copy link
Copy Markdown
Member

also manually merged into master

@prolic

prolic commented Nov 7, 2016

Copy link
Copy Markdown
Member

ChrisSanderser added a commit to ChrisSanderser/event-store that referenced this pull request Jan 31, 2024
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.

4 participants