Nats\ConnectionOptions::setPass PHP Method

setPass() public method

Set password.
public setPass ( string $pass )
$pass string Password.
    public function setPass($pass)
    {
        $this->pass = $pass;
        return $this;
    }

Usage Example

 /**
  * Test string representation of ConnectionOptions with credentials.
  *
  * @return void
  */
 public function testStringRepresentationWithCredentials()
 {
     $options = new ConnectionOptions();
     $options->setUser("username");
     $options->setPass("password");
     $this->assertEquals("{\"lang\":\"php\",\"version\":\"0.8.0\",\"verbose\":false,\"pedantic\":false,\"user\":\"username\",\"pass\":\"password\"}", $options->__toString());
 }