From d5758e1855d3eb1fbae27fde13b9c1d23779b1be Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 2 Aug 2018 12:12:44 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Socket.php | 1 - src/danog/MadelineProto/CombinedEventHandler.php | 1 + src/danog/MadelineProto/MTProtoTools/ResponseHandler.php | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Socket.php b/src/Socket.php index a485669d..c67647dd 100644 --- a/src/Socket.php +++ b/src/Socket.php @@ -311,7 +311,6 @@ if (!extension_loaded('pthreads')) { $buffer = substr($buffer, 0, $length); } - $try = 0; $wrote = socket_write($this->sock, $buffer, $length); while ($wrote < $length) { diff --git a/src/danog/MadelineProto/CombinedEventHandler.php b/src/danog/MadelineProto/CombinedEventHandler.php index adb0fe53..23699303 100644 --- a/src/danog/MadelineProto/CombinedEventHandler.php +++ b/src/danog/MadelineProto/CombinedEventHandler.php @@ -32,6 +32,7 @@ abstract class CombinedEventHandler foreach ($this->CombinedAPI->instance_paths as $path) { unset($keys[$path]); } + return array_keys($keys); } diff --git a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php index 9a21f3d7..fea9c263 100644 --- a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php @@ -347,6 +347,7 @@ trait ResponseHandler if ($server_answer['error_message'] === 'MSG_WAIT_FAILED') { throw new \danog\MadelineProto\RPCErrorException($server_answer['error_message'], $server_answer['error_code']); } + throw new \danog\MadelineProto\Exception('Re-executing query after server error...'); case 303: $this->datacenter->curdc = $aargs['datacenter'] = (int) preg_replace('/[^0-9]+/', '', $server_answer['error_message']);