fix required type for PhoneCallDiscardReason (#756)

* fix type for PhoneCallDiscardReason

* change PhoneCallDiscardReason parameters type to array
This commit is contained in:
Gabriele 2020-01-22 13:31:03 +01:00 committed by Daniil Gentili
parent db40848866
commit 91590ff360

View File

@ -67,7 +67,7 @@ trait AuthKeyHandler
*
* @return array
*/
public function discardCall(array $call, string $reason, array $rating = [], bool $need_debug = true): void
public function discardCall(array $call, array $reason, array $rating = [], bool $need_debug = true): void
{
\danog\MadelineProto\Tools::wait($this->discardCallAsync($call, $reason, $rating, $need_debug));
}
@ -140,7 +140,7 @@ trait AuthKeyHandler
}
if ($e->rpc === 'CALL_ALREADY_DECLINED') {
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['call_already_declined']);
yield $this->discardCallAsync($call['id'], 'phoneCallDiscardReasonHangup');
yield $this->discardCallAsync($call['id'], ['_' => 'phoneCallDiscardReasonHangup']);
return false;
}
@ -185,7 +185,7 @@ trait AuthKeyHandler
}
if ($e->rpc === 'CALL_ALREADY_DECLINED') {
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['call_already_declined']);
yield $this->discardCallAsync($call['id'], 'phoneCallDiscardReasonHangup');
yield $this->discardCallAsync($call['id'], ['_' => 'phoneCallDiscardReasonHangup']);
return false;
}
@ -296,7 +296,7 @@ trait AuthKeyHandler
*
* @return \Generator
*/
public function discardCallAsync(array $call, string $reason, array $rating = [], bool $need_debug = true): \Generator
public function discardCallAsync(array $call, array $reason, array $rating = [], bool $need_debug = true): \Generator
{
if (!\class_exists('\\danog\\MadelineProto\\VoIP')) {
throw \danog\MadelineProto\Exception::extension('libtgvoip');