src/whatsprot.class.php
public function sendData($data)
    {
        if ($this->isConnected()) {
            if (socket_write($this->socket, $data, strlen($data)) === false) {
                $this->eventManager()->fire('onClose',
                   [
                        $this->phoneNumber,
                        'Connection closed!',
                    ]
              );
            }
        }
    }
public function sendData($data)
    {
        if ($this->isConnected()) {
            if (socket_write($this->socket, $data, strlen($data)) === false) {
                $this->eventManager()->fire('onClose',
                   [
                        $this->phoneNumber,
                        'Connection closed!',
                    ]
              );
            }
        }
    }
public function sendData ( $ data ) { if ( $ this -> isConnected ( ) ) { if ( socket_write ( $ this -> socket , $ data , strlen ( $ data ) ) === false ) { $ this -> eventManager ( ) -> fire ( 'onClose' , [ $ this -> phoneNumber , 'Connection closed!' , ] ) ; } } }
Send data to the WhatsApp server.

@param string $data

@throws Exception
Send data to the WhatsApp server .