Skip to content

Commit

Permalink
Return null from if replaying
Browse files Browse the repository at this point in the history
  • Loading branch information
jdiddydave committed Dec 8, 2023
1 parent 68324e1 commit d6c70ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.vscode/
.phpunit.cache
.DS_Store
build
Expand Down
6 changes: 5 additions & 1 deletion src/Lifecycle/Broker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ public function __construct(
) {
}

public function fire(Event $event): Event
public function fire(Event $event): Event|null
{
if ($this->is_replaying) {
return null;
}

// NOTE: Any changes to how the dispatcher is called here
// should also be applied to the `replay` method

Expand Down

0 comments on commit d6c70ce

Please sign in to comment.