PayloadTrait requires payload to present
lezhnev74 opened this issue · comments
Hi,
I practiced using prooph messages. And I had cases where payload was not required at all. The name of the message was enough to perform the desired action.
Can we make it optional in PayloadTrait
?
Why do you then use the PayloadTrait
in your message?
Well, I inherited prooph's DomainMessage
class via Query/Command abstract classes for my queries and commands. Then to not implement it's methods I injected PayloadTrait
just to be consistent.
And then I started to use those queries and found out that sometimes I need no payload.
Looks like a valid use-case to me.
Released version 4.2.0 with optional payload: https://github.com/prooph/common/releases/tag/v4.2.0
Question by @sandrokeil was valid but it was not a big deal to align implementation.