From 995a48970426bf88a9f36427c0d35bc9ff6f23e9 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 18 Jan 2020 16:59:59 +0100 Subject: [PATCH] Fix type hinting --- src/danog/MadelineProto/MTProtoTools/Files.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/Files.php b/src/danog/MadelineProto/MTProtoTools/Files.php index 2efd554e..2401fe83 100644 --- a/src/danog/MadelineProto/MTProtoTools/Files.php +++ b/src/danog/MadelineProto/MTProtoTools/Files.php @@ -232,7 +232,7 @@ trait Files * * @return \Generator */ - public function uploadFromCallable($callable, int $size, string $mime, string $fileName = '', $cb = null, bool $seekable = true, bool $encrypted = false): \Generator + public function uploadFromCallable(callable $callable, int $size, string $mime, string $fileName = '', $cb = null, bool $seekable = true, bool $encrypted = false): \Generator { if (\is_object($callable) && $callable instanceof FileCallbackInterface) { $cb = $callable; @@ -446,9 +446,9 @@ trait Files * * @param integer $size Total file size * @param integer $partSize Part size - * @param callable $cb Callback + * @param ?callable $cb Callback */ - public function __construct(int $size, int $partSize, callable $cb) + public function __construct(int $size, int $partSize, ?callable $cb) { for ($x = 0; $x < $size; $x += $partSize) { $this->read []= new Deferred; @@ -1304,7 +1304,7 @@ trait Files } if (!isset($message_media['size'])) { - $origCb(100, 0, 0); + $origCb(100, $time, $speed); } return true;