Fix type hinting

This commit is contained in:
Daniil Gentili 2020-01-18 16:59:59 +01:00
parent 3939e113f5
commit 995a489704
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -232,7 +232,7 @@ trait Files
*
* @return \Generator<array>
*/
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;