original_string: public function login($nick, $password = null) {
  		if ($password) {
  			if (!$this->connection->send("PASS {$password}")) {
  				throw new \RuntimeException(
  					"failed to send password to {$this->server}");
  			}
  		} else {
  			if (!$this->connection->send("PASS NOPASS")) {
  				throw new \RuntimeException(
  					"failed to send nopass to {$this->server}");
  			}
  		}
  		
  		if (!$this->connection->send("NICK {$nick}")) {
  			throw new \RuntimeException(
  				"failed to set nick {$nick} on {$this->server}");
  		}
  		
  		$this->loop(false);
  		
  		if (!$this->connection->send("USER {$nick} AS IRC BOT")) {
  			throw new \RuntimeException(
  				"failed to set user {$nick} on {$this->server}");
  		}
  		
  		$this->loop(false);
  		
  		return $this;
  	}
code: public function login($nick, $password = null) {
  		if ($password) {
  			if (!$this->connection->send("PASS {$password}")) {
  				throw new \RuntimeException(
  					"failed to send password to {$this->server}");
  			}
  		} else {
  			if (!$this->connection->send("PASS NOPASS")) {
  				throw new \RuntimeException(
  					"failed to send nopass to {$this->server}");
  			}
  		}
  		
  		if (!$this->connection->send("NICK {$nick}")) {
  			throw new \RuntimeException(
  				"failed to set nick {$nick} on {$this->server}");
  		}
  		
  		$this->loop(false);
  		
  		if (!$this->connection->send("USER {$nick} AS IRC BOT")) {
  			throw new \RuntimeException(
  				"failed to set user {$nick} on {$this->server}");
  		}
  		
  		$this->loop(false);
  		
  		return $this;
  	}
code_tokens: public function login ( $ nick , $ password = null ) { if ( $ password ) { if ( ! $ this -> connection -> send ( "PASS {$password}" ) ) { throw new \ RuntimeException ( "failed to send password to {$this->server}" ) ; } } else { if ( ! $ this -> connection -> send ( "PASS NOPASS" ) ) { throw new \ RuntimeException ( "failed to send nopass to {$this->server}" ) ; } } if ( ! $ this -> connection -> send ( "NICK {$nick}" ) ) { throw new \ RuntimeException ( "failed to set nick {$nick} on {$this->server}" ) ; } $ this -> loop ( false ) ; if ( ! $ this -> connection -> send ( "USER {$nick} AS IRC BOT" ) ) { throw new \ RuntimeException ( "failed to set user {$nick} on {$this->server}" ) ; } $ this -> loop ( false ) ; return $ this ; }
docstring: Login into server as nick with optional password
  @param string nick
  @param string password
  @return Connection
  @throws \RuntimeException
docstring_tokens: Login into server as nick with optional password