Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-07-19 10:42:04 +00:00 committed by StyleCI Bot
parent 3a5e5a9c43
commit d2ce6c0684
4 changed files with 23 additions and 14 deletions

View File

@ -80,7 +80,12 @@ class Lua
if (is_callable($cb)) {
$cb($result, $cb_extra);
}
array_walk_recursive($result, function (&$value, $key) { if ($value instanceof \danog\MadelineProto\TL\Types\Button) $value = $value->jsonSerialize(); });
array_walk_recursive($result, function (&$value, $key) {
if ($value instanceof \danog\MadelineProto\TL\Types\Button) {
$value = $value->jsonSerialize();
}
});
return $result;
}

View File

@ -270,7 +270,9 @@ class MTProto extends \Volatile
foreach ($this->calls as $id => $controller) {
if (is_array($controller) || $controller->getCallState() === \danog\MadelineProto\VoIP::CALL_STATE_ENDED) {
unset($this->calls[$id]);
} else var_dump($controller->getCallState());
} else {
var_dump($controller->getCallState());
}
}
// Detect ipv6
$this->ipv6 = (bool) strlen(@file_get_contents('http://ipv6.test-ipv6.com/', false, stream_context_create(['http' => ['timeout' => 1]]))) > 0;

View File

@ -456,7 +456,7 @@ trait UpdateHandler
switch ($update['phone_call']['_']) {
case 'phoneCallRequested':
return $this->accept_call($update['phone_call']);
case 'phoneCallAccepted':
$this->confirm_call($update['phone_call']);

View File

@ -48,6 +48,7 @@ trait AuthKeyHandler
$this->handle_pending_updates();
$this->get_updates_difference();
return $controller;
}
@ -101,19 +102,19 @@ trait AuthKeyHandler
$this->calls[$params['id']]->configuration = array_merge([
'config' => [
'recv_timeout' => $this->config['call_receive_timeout_ms'] / 1000,
'init_timeout' => $this->config['call_connect_timeout_ms'] / 1000,
'data_saving' => \danog\MadelineProto\VoIP::DATA_SAVING_NEVER,
'enable_NS' => true,
'enable_AEC' => true,
'enable_AGC' => true,
'log_file_path' => $this->settings['calls']['log_file_path'],
'stats_dump_file_path' => $this->settings['calls']['stats_dump_file_path']
'recv_timeout' => $this->config['call_receive_timeout_ms'] / 1000,
'init_timeout' => $this->config['call_connect_timeout_ms'] / 1000,
'data_saving' => \danog\MadelineProto\VoIP::DATA_SAVING_NEVER,
'enable_NS' => true,
'enable_AEC' => true,
'enable_AGC' => true,
'log_file_path' => $this->settings['calls']['log_file_path'],
'stats_dump_file_path' => $this->settings['calls']['stats_dump_file_path'],
],
'auth_key' => $key['auth_key'],
'network_type' => $this->settings['calls']['network_type'],
'auth_key' => $key['auth_key'],
'network_type' => $this->settings['calls']['network_type'],
'shared_config' => $this->method_call('phone.getCallConfig', [], ['datacenter' => $this->datacenter->curdc]),
'endpoints' => array_merge([$res['connection']], $res['alternative_connections']),
'endpoints' => array_merge([$res['connection']], $res['alternative_connections']),
], $this->calls[$params['id']]->configuration);
$this->calls[$params['id']]->parseConfig();
$this->calls[$params['id']]->startTheMagic();
@ -191,6 +192,7 @@ trait AuthKeyHandler
unset($this->calls[$id]);
}
}
return $this->calls[$call];
}