src/Detail/Bernard/Message/Messenger.php
public function encodeMessage($message, $queue)
    {
        $messageFactory = $this->getMessageFactory();

        if (!$this->messageFactory->accepts($message)) {
            throw new Exception\RuntimeException(
                sprintf(
                    '%s does not accept message of type "%s"',
                    get_class($messageFactory),
                    (is_object($message) ? get_class($message) : gettype($message))
                )
            );
        }

        return new BernardDefaultMessage(
            $queue,
            array(
                self::MESSAGE_CLASS_KEY => get_class($message),
                self::MESSAGE_KEY => $this->getMessageFactory()->toArray($message),
            )
        );
    }
public function encodeMessage($message, $queue)
    {
        $messageFactory = $this->getMessageFactory();

        if (!$this->messageFactory->accepts($message)) {
            throw new Exception\RuntimeException(
                sprintf(
                    '%s does not accept message of type "%s"',
                    get_class($messageFactory),
                    (is_object($message) ? get_class($message) : gettype($message))
                )
            );
        }

        return new BernardDefaultMessage(
            $queue,
            array(
                self::MESSAGE_CLASS_KEY => get_class($message),
                self::MESSAGE_KEY => $this->getMessageFactory()->toArray($message),
            )
        );
    }
public function encodeMessage ( $ message , $ queue ) { $ messageFactory = $ this -> getMessageFactory ( ) ; if ( ! $ this -> messageFactory -> accepts ( $ message ) ) { throw new Exception \ RuntimeException ( sprintf ( '%s does not accept message of type "%s"' , get_class ( $ messageFactory ) , ( is_object ( $ message ) ? get_class ( $ message ) : gettype ( $ message ) ) ) ) ; } return new BernardDefaultMessage ( $ queue , array ( self :: MESSAGE_CLASS_KEY => get_class ( $ message ) , self :: MESSAGE_KEY => $ this -> getMessageFactory ( ) -> toArray ( $ message ) , ) ) ; }
Encode message for Bernard.

@param mixed $message
@param string $queue
@throws Exception\RuntimeException
@return BernardDefaultMessage
Encode message for Bernard .