diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index 66811e3d..e4b48af6 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -88,6 +88,7 @@ class Connection if (!(get_resource_type($this->sock) == 'file' || get_resource_type($this->sock) == 'stream')) { throw new Exception("Connection: couldn't connect to socket."); } + return fwrite($this->sock, $what); break; default: diff --git a/src/danog/MadelineProto/Session.php b/src/danog/MadelineProto/Session.php index dceaea2f..ac60eb9c 100755 --- a/src/danog/MadelineProto/Session.php +++ b/src/danog/MadelineProto/Session.php @@ -105,7 +105,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB */ public function send_message($message_data) { - switch ($this->settings["protocol"]) { + switch ($this->settings['protocol']) { case 'tcp_full': $message_id = $this->struct->pack('timedelta) * pow(2, 30)) * 4); if (($this->auth_key == null) || ($this->server_salt == null)) { @@ -134,7 +134,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB */ public function recv_message() { - switch ($this->settings["protocol"]) { + switch ($this->settings['protocol']) { case 'tcp_full': $packet_length_data = $this->sock->read(4); if (strlen($packet_length_data) < 4) { diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 8219ec39..5aec32e7 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -16,7 +16,7 @@ class TL { public function __construct($filename) { - if(is_array($filename)) { + if (is_array($filename)) { $TL_dict = []; foreach ($filename as $file) { $TL_dict = array_replace(json_decode(file_get_contents($file), true), $TL_dict);