Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-05-02 10:13:27 +00:00 committed by StyleCI Bot
parent 35c0a6bd67
commit 4b3c010c4c
4 changed files with 12 additions and 4 deletions

View File

@ -296,7 +296,9 @@ trait PeerHandler
switch ($partial['type']) {
case 'user':
case 'bot':
if (!isset($partial['InputUser'])) throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
if (!isset($partial['InputUser'])) {
throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
}
$full = $this->method_call('users.getFullUser', ['id' => $partial['InputUser']], ['datacenter' => $this->datacenter->curdc]);
break;

View File

@ -138,7 +138,9 @@ trait UpdateHandler
}
try {
$input = $this->get_info('channel#'.$channel);
if (!isset($input['InputChannel'])) throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
if (!isset($input['InputChannel'])) {
throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
}
$input = $input['InputChannel'];
} catch (\danog\MadelineProto\Exception $e) {
return false;

View File

@ -45,7 +45,9 @@ trait AuthKeyHandler
{
$this->should_serialize = true;
$user = $this->get_info($user);
if (!isset($user['InputUser'])) throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
if (!isset($user['InputUser'])) {
throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
}
$user = $user['InputUser'];
\danog\MadelineProto\Logger::log(['Creating secret chat with '.$user['user_id'].'...'], \danog\MadelineProto\Logger::VERBOSE);
$dh_config = $this->get_dh_config();

View File

@ -30,7 +30,9 @@ trait AuthKeyHandler
public function request_call($user)
{
$user = $this->get_info($user);
if (!isset($user['InputUser'])) throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
if (!isset($user['InputUser'])) {
throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
}
$user = $user['InputUser'];
\danog\MadelineProto\Logger::log(['Calling '.$user['user_id'].'...'], \danog\MadelineProto\Logger::VERBOSE);
$dh_config = $this->get_dh_config();