From fc312b137d10c59ab8945c4cc46933f3e16a7795 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 11 Dec 2019 16:22:34 +0100 Subject: [PATCH] Quickfix --- src/danog/MadelineProto/DataCenter.php | 4 ++-- src/danog/MadelineProto/InternalDoc.php | 24 +++++++++---------- .../Loop/Connection/ReadLoop.php | 1 - .../MTProtoSession/ResponseHandler.php | 1 - src/danog/MadelineProto/TL/TL.php | 4 ++-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/danog/MadelineProto/DataCenter.php b/src/danog/MadelineProto/DataCenter.php index efa02fd2..4801dfc4 100644 --- a/src/danog/MadelineProto/DataCenter.php +++ b/src/danog/MadelineProto/DataCenter.php @@ -873,10 +873,10 @@ class DataCenter } /** - * Get contents of file + * Get contents of file. * * @param string $url URL to fetch - * + * * @return \Generator */ public function fileGetContents(string $url): \Generator diff --git a/src/danog/MadelineProto/InternalDoc.php b/src/danog/MadelineProto/InternalDoc.php index 8e545502..82d325e8 100644 --- a/src/danog/MadelineProto/InternalDoc.php +++ b/src/danog/MadelineProto/InternalDoc.php @@ -5092,11 +5092,11 @@ class InternalDoc extends APIFactory /** * Convert double to binary version. * - * @param double $value Value to convert + * @param float $value Value to convert * * @return string */ - public function packDouble(\danog\MadelineProto\double $value, array $extra = []): string + public function packDouble(float $value, array $extra = []): string { return $this->__call(__FUNCTION__, [$value, $extra]); } @@ -5105,9 +5105,9 @@ class InternalDoc extends APIFactory * * @param string $value Value to unpack * - * @return double + * @return float */ - public function unpackDouble(string $value, array $extra = []): danog\MadelineProto\double + public function unpackDouble(string $value, array $extra = []): float { return $this->__call(__FUNCTION__, [$value, $extra]); } @@ -5199,7 +5199,7 @@ class InternalDoc extends APIFactory * @param ?\Generator|Promise $actual Promise to resolve instead of $promise * @param string $file File * - * @return void + * @return Promise */ public function callFork($promise, $actual = null, $file = '', array $extra = []) { @@ -5258,11 +5258,11 @@ class InternalDoc extends APIFactory * * @param string $file File to lock * @param integer $operation Locking mode - * @param integer $polling Polling interval + * @param float $polling Polling interval * * @return Promise */ - public function flock(string $file, int $operation, $polling = 0.1, array $extra = []) + public function flock(string $file, int $operation, float $polling = 0.1, array $extra = []) { return $this->__call(__FUNCTION__, [$file, $operation, $polling, $extra]); } @@ -5271,11 +5271,11 @@ class InternalDoc extends APIFactory * * @param string $file File to lock * @param integer $operation Locking mode - * @param integer $polling Polling interval + * @param float $polling Polling interval * - * @return void + * @return \Generator */ - public function flockGenerator(string $file, int $operation, $polling, array $extra = []) + public function flockGenerator(string $file, int $operation, float $polling, array $extra = []) { return $this->__call(__FUNCTION__, [$file, $operation, $polling, $extra]); } @@ -5306,7 +5306,7 @@ class InternalDoc extends APIFactory * * @param string $prompt Prompt * - * @return void + * @return \Generator */ public function readLineGenerator(string $prompt = '', array $extra = []) { @@ -5330,7 +5330,7 @@ class InternalDoc extends APIFactory * * @return boolean */ - public function isArrayOrAlike($var, array $extra = []) + public function isArrayOrAlike($var, array $extra = []): bool { return $this->__call(__FUNCTION__, [$var, $extra]); } diff --git a/src/danog/MadelineProto/Loop/Connection/ReadLoop.php b/src/danog/MadelineProto/Loop/Connection/ReadLoop.php index 7b9042f3..94cb94c6 100644 --- a/src/danog/MadelineProto/Loop/Connection/ReadLoop.php +++ b/src/danog/MadelineProto/Loop/Connection/ReadLoop.php @@ -174,7 +174,6 @@ class ReadLoop extends SignalLoop $auth_key_id = yield $buffer->bufferRead(8); if ($auth_key_id === "\0\0\0\0\0\0\0\0") { - $message_id = yield $buffer->bufferRead(8); if (!\in_array($message_id, [1, 0])) { $connection->checkMessageId($message_id, ['outgoing' => false, 'container' => false]); diff --git a/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php b/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php index de25dcb3..e3ec2ae5 100644 --- a/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php @@ -27,7 +27,6 @@ use danog\MadelineProto\MTProto; */ trait ResponseHandler { - public function sendMsgsStateInfo($req_msg_id, $msg_ids) { $this->logger->logger('Sending state info for '.\count($msg_ids).' message IDs'); diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 19390300..076b5446 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -269,11 +269,11 @@ class TL if ($scheme_type === 'secret') { $this->secretLayer = \max($this->secretLayer, $elem['layer']); } - $this->{($scheme_type === 'td' ? 'td_' : '').'constructors'}->add($elem, $scheme_type); + $this->{$scheme_type === 'td' ? 'tdConstructors' : 'constructors'}->add($elem, $scheme_type); } $this->API->logger->logger(\danog\MadelineProto\Lang::$current_lang['translating_methods'], \danog\MadelineProto\Logger::ULTRA_VERBOSE); foreach ($TL_dict['methods'] as $elem) { - $this->{($scheme_type === 'td' ? 'td_' : '').'methods'}->add($elem); + $this->{$scheme_type === 'td' ? 'tdMethods' : 'methods'}->add($elem); if ($scheme_type === 'secret') { $this->secretLayer = \max($this->secretLayer, $elem['layer']); }