Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2016-12-24 16:21:15 +00:00 committed by StyleCI Bot
parent 34865686da
commit 7515530b37
6 changed files with 17 additions and 11 deletions

View File

@ -77,7 +77,6 @@ foreach ($TL->methods->method as $key => $method) {
$types[$real_type]['methods'][] = $key; $types[$real_type]['methods'][] = $key;
} }
$params = ''; $params = '';
foreach ($TL->methods->params[$key] as $param) { foreach ($TL->methods->params[$key] as $param) {
if (in_array($param['name'], ['flags', 'random_id'])) { if (in_array($param['name'], ['flags', 'random_id'])) {

View File

@ -59,5 +59,4 @@ class API extends APIFactory
$this->{$namespace} = new APIFactory($namespace, $this->API); $this->{$namespace} = new APIFactory($namespace, $this->API);
} }
} }
} }

View File

@ -53,5 +53,4 @@ trait PeerHandler
} }
} }
} }
} }

View File

@ -72,10 +72,18 @@ trait ResponseHandler
$response = $this->datacenter->incoming_messages[$current_msg_id]['content']; $response = $this->datacenter->incoming_messages[$current_msg_id]['content'];
\danog\MadelineProto\Logger::log('Received '.$response['_'].'.'); \danog\MadelineProto\Logger::log('Received '.$response['_'].'.');
if (isset($response['users'])) $this->add_users($response['users']); if (isset($response['users'])) {
if (isset($response['chats'])) $this->add_chats($response['chats']); $this->add_users($response['users']);
if (isset($response['result']['users'])) $this->add_users($response['result']['users']); }
if (isset($response['result']['chats'])) $this->add_chats($response['result']['chats']); if (isset($response['chats'])) {
$this->add_chats($response['chats']);
}
if (isset($response['result']['users'])) {
$this->add_users($response['result']['users']);
}
if (isset($response['result']['chats'])) {
$this->add_chats($response['result']['chats']);
}
switch ($response['_']) { switch ($response['_']) {
case 'msgs_ack': case 'msgs_ack':
foreach ($response['msg_ids'] as $msg_id) { foreach ($response['msg_ids'] as $msg_id) {
@ -119,7 +127,9 @@ trait ResponseHandler
\danog\MadelineProto\Logger::log('new session created'); \danog\MadelineProto\Logger::log('new session created');
\danog\MadelineProto\Logger::log($response); \danog\MadelineProto\Logger::log($response);
unset($this->datacenter->new_incoming[$current_msg_id]); unset($this->datacenter->new_incoming[$current_msg_id]);
if ($this->datacenter->authorized) $this->get_updates_state(); if ($this->datacenter->authorized) {
$this->get_updates_state();
}
break; break;
case 'msg_container': case 'msg_container':

View File

@ -70,7 +70,7 @@ trait UpdateHandler
case 'updateShortMessage': case 'updateShortMessage':
case 'updateShortChatMessage': case 'updateShortChatMessage':
case 'updateShortSentMessage': case 'updateShortSentMessage':
$update = ['_' => 'updateNewMessage',]; $update = ['_' => 'updateNewMessage'];
$this->handle_update_messages($update, ['date' => $updates['date']]); $this->handle_update_messages($update, ['date' => $updates['date']]);
break; break;
case 'updateShort': case 'updateShort':

View File

@ -13,7 +13,7 @@ If not, see <http://www.gnu.org/licenses/>.
namespace danog\MadelineProto\Wrappers; namespace danog\MadelineProto\Wrappers;
/** /**
* Manages logging in and out * Manages logging in and out.
*/ */
trait Login trait Login
{ {
@ -96,5 +96,4 @@ trait Login
return $this->API->datacenter->authorization; return $this->API->datacenter->authorization;
} }
} }