This commit is contained in:
Daniil Gentili 2019-12-11 16:22:34 +01:00
parent 0cb8d7f27e
commit fc312b137d
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
5 changed files with 16 additions and 18 deletions

View File

@ -873,10 +873,10 @@ class DataCenter
} }
/** /**
* Get contents of file * Get contents of file.
* *
* @param string $url URL to fetch * @param string $url URL to fetch
* *
* @return \Generator<string> * @return \Generator<string>
*/ */
public function fileGetContents(string $url): \Generator public function fileGetContents(string $url): \Generator

View File

@ -5092,11 +5092,11 @@ class InternalDoc extends APIFactory
/** /**
* Convert double to binary version. * Convert double to binary version.
* *
* @param double $value Value to convert * @param float $value Value to convert
* *
* @return string * @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]); return $this->__call(__FUNCTION__, [$value, $extra]);
} }
@ -5105,9 +5105,9 @@ class InternalDoc extends APIFactory
* *
* @param string $value Value to unpack * @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]); 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 ?\Generator|Promise $actual Promise to resolve instead of $promise
* @param string $file File * @param string $file File
* *
* @return void * @return Promise
*/ */
public function callFork($promise, $actual = null, $file = '', array $extra = []) public function callFork($promise, $actual = null, $file = '', array $extra = [])
{ {
@ -5258,11 +5258,11 @@ class InternalDoc extends APIFactory
* *
* @param string $file File to lock * @param string $file File to lock
* @param integer $operation Locking mode * @param integer $operation Locking mode
* @param integer $polling Polling interval * @param float $polling Polling interval
* *
* @return Promise * @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]); return $this->__call(__FUNCTION__, [$file, $operation, $polling, $extra]);
} }
@ -5271,11 +5271,11 @@ class InternalDoc extends APIFactory
* *
* @param string $file File to lock * @param string $file File to lock
* @param integer $operation Locking mode * @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]); return $this->__call(__FUNCTION__, [$file, $operation, $polling, $extra]);
} }
@ -5306,7 +5306,7 @@ class InternalDoc extends APIFactory
* *
* @param string $prompt Prompt * @param string $prompt Prompt
* *
* @return void * @return \Generator
*/ */
public function readLineGenerator(string $prompt = '', array $extra = []) public function readLineGenerator(string $prompt = '', array $extra = [])
{ {
@ -5330,7 +5330,7 @@ class InternalDoc extends APIFactory
* *
* @return boolean * @return boolean
*/ */
public function isArrayOrAlike($var, array $extra = []) public function isArrayOrAlike($var, array $extra = []): bool
{ {
return $this->__call(__FUNCTION__, [$var, $extra]); return $this->__call(__FUNCTION__, [$var, $extra]);
} }

View File

@ -174,7 +174,6 @@ class ReadLoop extends SignalLoop
$auth_key_id = yield $buffer->bufferRead(8); $auth_key_id = yield $buffer->bufferRead(8);
if ($auth_key_id === "\0\0\0\0\0\0\0\0") { if ($auth_key_id === "\0\0\0\0\0\0\0\0") {
$message_id = yield $buffer->bufferRead(8); $message_id = yield $buffer->bufferRead(8);
if (!\in_array($message_id, [1, 0])) { if (!\in_array($message_id, [1, 0])) {
$connection->checkMessageId($message_id, ['outgoing' => false, 'container' => false]); $connection->checkMessageId($message_id, ['outgoing' => false, 'container' => false]);

View File

@ -27,7 +27,6 @@ use danog\MadelineProto\MTProto;
*/ */
trait ResponseHandler trait ResponseHandler
{ {
public function sendMsgsStateInfo($req_msg_id, $msg_ids) public function sendMsgsStateInfo($req_msg_id, $msg_ids)
{ {
$this->logger->logger('Sending state info for '.\count($msg_ids).' message IDs'); $this->logger->logger('Sending state info for '.\count($msg_ids).' message IDs');

View File

@ -269,11 +269,11 @@ class TL
if ($scheme_type === 'secret') { if ($scheme_type === 'secret') {
$this->secretLayer = \max($this->secretLayer, $elem['layer']); $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); $this->API->logger->logger(\danog\MadelineProto\Lang::$current_lang['translating_methods'], \danog\MadelineProto\Logger::ULTRA_VERBOSE);
foreach ($TL_dict['methods'] as $elem) { 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') { if ($scheme_type === 'secret') {
$this->secretLayer = \max($this->secretLayer, $elem['layer']); $this->secretLayer = \max($this->secretLayer, $elem['layer']);
} }