Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-03-25 16:42:36 +00:00 committed by StyleCI Bot
parent cde197a2bf
commit 29d5683214
2 changed files with 8 additions and 6 deletions

View File

@ -276,10 +276,10 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
'tl_schema' => [ // TL scheme files
'layer' => 62, // layer version
'src' => [
'mtproto' => __DIR__.'/TL_mtproto_v1.json', // mtproto TL scheme
'telegram' => __DIR__.'/TL_telegram_v62.tl', // telegram TL scheme
'secret' => __DIR__.'/TL_secret.tl', // secret chats TL scheme
'td' => __DIR__.'/TL_td.tl', // telegram-cli TL scheme
'mtproto' => __DIR__.'/TL_mtproto_v1.json', // mtproto TL scheme
'telegram' => __DIR__.'/TL_telegram_v62.tl', // telegram TL scheme
'secret' => __DIR__.'/TL_secret.tl', // secret chats TL scheme
'td' => __DIR__.'/TL_td.tl', // telegram-cli TL scheme
'botAPI' => __DIR__.'/TL_botAPI.tl', // bot API TL scheme for file ids
],
],

View File

@ -68,7 +68,7 @@ trait BotAPIFiles
$ext = $this->get_extension_from_location(['_' => 'inputFileLocation', 'volume_id' => $photo['location']['volume_id'], 'local_id' => $photo['location']['local_id'], 'secret' => $photo['location']['secret'], 'dc_id' => $photo['location']['dc_id']], '.jpg');
$photo['location']['access_hash'] = isset($message_media['access_hash']) ? $message_media['access_hash'] : 0;
$photo['location']['id'] = isset($message_media['id']) ? $message_media['id'] : 0;
$data = $this->serialize_object(['type' => $thumbnail ? 'bot_thumbnail' : 'bot_photo'], $photo['location']).chr(2);
return [
@ -84,7 +84,9 @@ trait BotAPIFiles
public function unpack_file_id($file_id)
{
$file_id = $this->rle_decode($this->base64url_decode($file_id));
if ($file_id[strlen($file_id) - 1] !== chr(2)) throw new Exception('Invalid last byte');
if ($file_id[strlen($file_id) - 1] !== chr(2)) {
throw new Exception('Invalid last byte');
}
$deserialized = $this->deserialize($file_id);
$res = ['type' => str_replace('bot_', $deserialized['_'])];
switch ($deserialized['_']) {