/**
  * {@inheritdoc}
  */
 public function execute($command, callable $next)
 {
     // Check that the command expects a response
     if (!$command instanceof Command || empty($command->getEnvelope()->getReplyTo())) {
         return $next($command);
     }
     // Execute command
     $result = $next($command);
     // Transform result
     $message = $this->transformer->transformCommandResponse($result);
     // Publish the response message
     $publisher = $this->getPublisher($command);
     $publisher->publish($message);
     return $result;
 }