Nats\Message::__toString PHP Method

__toString() public method

String representation of a message.
public __toString ( ) : string
return string
    public function __toString()
    {
        return $this->getBody();
    }

Usage Example

Beispiel #1
0
 /**
  * Tests Message string representation.
  *
  * @return void
  */
 public function testMessageStringRepresentation()
 {
     $conn = new Connection();
     $msg = new Message('subject', 'body', 'sid', $conn);
     $this->assertEquals('body', $msg->__toString());
 }