/** * {@inheritdoc} */ public function process(CommandMessage $message, callable $next) { $name = $message->payloadType()->toString(); $this->logger->info(sprintf('Command received {%s}', $name), ['message' => $message->toString()]); $next($message); $this->logger->info(sprintf('Command handled {%s}', $name), ['message' => $message->toString()]); }
/** * {@inheritdoc} */ public function process(CommandMessage $message, callable $next) { $command = ClassName::short($message->payloadType()->toString()); try { $this->logger->debug(sprintf('Command (%s) received: %s', $command, date(DATE_ATOM)), ['message' => $message->toString()]); $next($message); $this->logger->debug(sprintf('Command (%s) handled: %s', $command, date(DATE_ATOM)), ['message' => $message->toString()]); } catch (Exception $exception) { $this->logger->error(sprintf('Command (%s) failed: %s', $command, date(DATE_ATOM)), ['message' => $message->toString(), 'exception' => $exception]); throw $exception; } }
/** * {@inheritdoc} */ public function process(CommandMessage $message, callable $next) { /** @var Command $command */ $command = $message->payload(); $this->commandBus->execute($command); }
/** * {@inheritdoc} */ public function process(CommandMessage $message, callable $next) { $command = $message->payload(); $handler = $this->resolver->resolve($command); $handler->handle($command); }
/** * @expectedException \AssertionError */ public function test_that_compare_to_throws_exception_for_invalid_argument() { $this->message->compareTo(null); }