A message (command, event, etc.) can be any object now, so just remove any type-hint or replace type-hints by more specific ones.
The Message
type-hint has been removed from the following methods:
SimpleBus\Message\Bus\MessageBus::handle
SimpleBus\Message\Bus\Middleware\MessageBusMiddleware::handle
SimpleBus\Message\Handler\Resolver\MessageHandlerResolver::resolve
SimpleBus\Message\Subscriber\Resolver\MessageSubscribersResolver::resolve
SimpleBus\Message\Name\MessageNameResolver::resolve
Message handlers can be any callable now, so just remove the
implements MessageHandler
from your message handler class
definitions.
Message subscribers can be any callable now, so just remove the
implements MessageSubscriber
from your message handler class
definitions.
Instead, handlers and subscribers can now be any callable you like. Also, they are assumed to be always lazy-loading (because they should never all be instantiated at the same time). See the updated documentation for examples on how to configure these objects.