public function logoutAndDisconnect()
    {
        if($this->connected)
        {
            // Adds some delay defore disconnect
            sleep(rand(1, 2));
            
            $this->offline();
            $this->whatsProt->disconnect();

            $this->connected = false;
        }
    }
public function logoutAndDisconnect()
    {
        if($this->connected)
        {
            // Adds some delay defore disconnect
            sleep(rand(1, 2));
            
            $this->offline();
            $this->whatsProt->disconnect();

            $this->connected = false;
        }
    }
public function logoutAndDisconnect ( ) { if ( $ this -> connected ) { // Adds some delay defore disconnect sleep ( rand ( 1 , 2 ) ) ; $ this -> offline ( ) ; $ this -> whatsProt -> disconnect ( ) ; $ this -> connected = false ; } }
Logout and disconnect from Whatsapp server

@return void
Logout and disconnect from Whatsapp server