public function publish(MessageInterface $message)
    {
        if (count($this->transports) == 0) {
            throw new RuntimeException(
                "Publisher requires at least one transport"
            );
        }

        $reason = '';
        if (!$this->messageValidator->validate($message, $reason)) {
            throw new RuntimeException("Message is invalid: $reason");
        }

        foreach ($this->transports as $transport) {
            /* @var $transport TransportInterface */
            $transport->send($message);
        }
    }
public function publish(MessageInterface $message)
    {
        if (count($this->transports) == 0) {
            throw new RuntimeException(
                "Publisher requires at least one transport"
            );
        }

        $reason = '';
        if (!$this->messageValidator->validate($message, $reason)) {
            throw new RuntimeException("Message is invalid: $reason");
        }

        foreach ($this->transports as $transport) {
            /* @var $transport TransportInterface */
            $transport->send($message);
        }
    }
public function publish ( MessageInterface $ message ) { if ( count ( $ this -> transports ) == 0 ) { throw new RuntimeException ( "Publisher requires at least one transport" ) ; } $ reason = '' ; if ( ! $ this -> messageValidator -> validate ( $ message , $ reason ) ) { throw new RuntimeException ( "Message is invalid: $reason" ) ; } foreach ( $ this -> transports as $ transport ) { /* @var $transport TransportInterface */ $ transport -> send ( $ message ) ; } }
Publish a message over all defined transports

@param MessageInterface $message
Publish a message over all defined transports