From 29d568321495a217e12f23f924f8d984ca189bc5 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 25 Mar 2017 16:42:36 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/danog/MadelineProto/MTProto.php | 8 ++++---- src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index d2319765c..9e3eaa941 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -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 ], ], diff --git a/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php b/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php index 12a34b43d..66d9ad70d 100644 --- a/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php +++ b/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php @@ -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['_']) {