hirethunk / verbs

Verbs is an event sourcing package for PHP artisans
https://verbs.thunk.dev
MIT License
412 stars 32 forks source link

Use existing event object in `verb()` helper #134

Closed inxilpro closed 5 months ago

inxilpro commented 5 months ago

It's possible for PendingEvent::fire() to return null if you're firing an event from a handle method during replay. This is the correct behavior, but breaks the type expectations of verb(). The fix is to just return the original event, rather than rewriting the variable.