/** * {@inheritdoc} */ public function execute(Command $command) { $handler = $this->resolver->resolve($command); try { $handler->handle($command); } catch (Exception $exception) { throw CommandException::create($exception->getMessage(), $exception); } }
/** * {@inheritdoc} */ public function process(CommandMessage $message, callable $next) { $command = $message->payload(); $handler = $this->resolver->resolve($command); $handler->handle($command); }