Skip to content

Commit

Permalink
fix required type for PhoneCallDiscardReason (#756)
Browse files Browse the repository at this point in the history
* fix type for PhoneCallDiscardReason

* change PhoneCallDiscardReason parameters type to array
  • Loading branch information
Gabriele authored and danog committed Jan 22, 2020
1 parent db40848 commit 91590ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/danog/MadelineProto/VoIP/AuthKeyHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function acceptCall(array $user): bool
*
* @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));
}
Expand Down Expand Up @@ -140,7 +140,7 @@ public function acceptCallAsync(array $call): \Generator
}
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;
}
Expand Down Expand Up @@ -185,7 +185,7 @@ public function confirmCall(array $params): \Generator
}
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;
}
Expand Down Expand Up @@ -296,7 +296,7 @@ public function getCall(int $call): array
*
* @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');
Expand Down

0 comments on commit 91590ff

Please sign in to comment.