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

@ -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['_']) {