Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-07-21 23:02:48 +00:00 committed by StyleCI Bot
parent 908fb3854f
commit 1dc451d6bb
2 changed files with 12 additions and 4 deletions

View File

@ -322,9 +322,15 @@ class MTProto extends \Volatile
unset($settings['authorization']['rsa_key']);
}
foreach ($settings['connection_settings'] as $key => &$connection) {
if (!is_array($connection)) continue;
if (!isset($connection['proxy'])) $connection['proxy'] = '\Socket';
if (!isset($connection['proxy_extra'])) $connection['proxy_extra'] = [];
if (!is_array($connection)) {
continue;
}
if (!isset($connection['proxy'])) {
$connection['proxy'] = '\Socket';
}
if (!isset($connection['proxy_extra'])) {
$connection['proxy_extra'] = [];
}
}
if (!isset($settings['authorization']['rsa_key'])) {
unset($settings['authorization']['rsa_key']);

View File

@ -236,7 +236,9 @@ trait AuthKeyHandler
if (!class_exists('\danog\MadelineProto\VoIP')) {
throw new \danog\MadelineProto\Exception('The php-libtgvoip extension is required to accept and manage calls. See daniil.it/MadelineProto for more info.');
}
if (!isset($this->calls[$call['id']])) return;
if (!isset($this->calls[$call['id']])) {
return;
}
\danog\MadelineProto\Logger::log(['Discarding call '.$call['id'].'...'], \danog\MadelineProto\Logger::VERBOSE);
try {
$res = $this->method_call('phone.discardCall', ['peer' => $call, 'duration' => time() - $this->calls[$call['id']]->whenCreated(), 'connection_id' => $this->calls[$call['id']]->getPreferredRelayID(), 'reason' => $reason], ['datacenter' => $this->datacenter->curdc]);