@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | return is_array($data) && |
42 | 42 | array_key_exists('text', $data) && ( |
43 | - array_key_exists('url', $data) || |
|
43 | + array_key_exists('url', $data) || |
|
44 | 44 | array_key_exists('callback_data', $data) || |
45 | 45 | array_key_exists('switch_inline_query', $data) |
46 | 46 | ); |
@@ -278,8 +278,8 @@ |
||
278 | 278 | public function stripMarkDown($string) |
279 | 279 | { |
280 | 280 | return str_replace( |
281 | - ['[', '`', '*', '_',], |
|
282 | - ['\[', '\`', '\*', '\_',], |
|
281 | + ['[', '`', '*', '_', ], |
|
282 | + ['\[', '\`', '\*', '\_', ], |
|
283 | 283 | $string |
284 | 284 | ); |
285 | 285 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | |
91 | 91 | $data = reset($args); |
92 | 92 | |
93 | - if ($from_data = array_key_exists($keyboard_type, (array)$data)) { |
|
93 | + if ($from_data = array_key_exists($keyboard_type, (array) $data)) { |
|
94 | 94 | $args = $data[$keyboard_type]; |
95 | 95 | |
96 | 96 | // Make sure we're working with a proper row. |
@@ -238,7 +238,7 @@ |
||
238 | 238 | * |
239 | 239 | * @param \Longman\TelegramBot\Entities\File $file |
240 | 240 | * |
241 | - * @return boolean |
|
241 | + * @return boolean|string |
|
242 | 242 | * @throws \Longman\TelegramBot\Exception\TelegramException |
243 | 243 | */ |
244 | 244 | public static function downloadFile(File $file) |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'first_name' => 'botname', |
157 | 157 | 'username' => 'namebot', |
158 | 158 | ]; |
159 | - $data['chat'] = ['id' => $data['chat_id']]; |
|
159 | + $data['chat'] = ['id' => $data['chat_id']]; |
|
160 | 160 | |
161 | 161 | $fake_response['result'] = $data; |
162 | 162 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | //Fix so that the keyboard markup is a string, not an object |
206 | 206 | if (isset($data['reply_markup'])) { |
207 | - $data['reply_markup'] = (string)$data['reply_markup']; |
|
207 | + $data['reply_markup'] = (string) $data['reply_markup']; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | $request_params = self::setUpRequestParams($data); |
@@ -217,14 +217,14 @@ discard block |
||
217 | 217 | '/bot' . self::$telegram->getApiKey() . '/' . $action, |
218 | 218 | $request_params |
219 | 219 | ); |
220 | - $result = (string)$response->getBody(); |
|
220 | + $result = (string) $response->getBody(); |
|
221 | 221 | |
222 | 222 | //Logging getUpdates Update |
223 | 223 | if ($action === 'getUpdates') { |
224 | 224 | TelegramLog::update($result); |
225 | 225 | } |
226 | 226 | } catch (RequestException $e) { |
227 | - $result = (string)$e->getResponse()->getBody(); |
|
227 | + $result = (string) $e->getResponse()->getBody(); |
|
228 | 228 | } finally { |
229 | 229 | //Logging verbose debug output |
230 | 230 | TelegramLog::endDebugLogTempStream("Verbose HTTP Request output:\n%s\n"); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | |
264 | 264 | return filesize($file_path) > 0; |
265 | 265 | } catch (RequestException $e) { |
266 | - return (string)$e->getResponse()->getBody(); |
|
266 | + return (string) $e->getResponse()->getBody(); |
|
267 | 267 | } finally { |
268 | 268 | //Logging verbose debug output |
269 | 269 | TelegramLog::endDebugLogTempStream("Verbose HTTP File Download Request output:\n%s\n"); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | unset($data['raw_data']); |
37 | 37 | $data['raw_data'] = $data; |
38 | 38 | |
39 | - $is_ok = isset($data['ok']) ? (bool)$data['ok'] : false; |
|
39 | + $is_ok = isset($data['ok']) ? (bool) $data['ok'] : false; |
|
40 | 40 | $result = isset($data['result']) ? $data['result'] : null; |
41 | 41 | |
42 | 42 | if ($is_ok && is_array($result)) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function isOk() |
73 | 73 | { |
74 | - return (bool)$this->getOk(); |
|
74 | + return (bool) $this->getOk(); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | |
101 | 101 | $result_object_types = [ |
102 | 102 | 'total_count' => 'UserProfilePhotos', //Response from getUserProfilePhotos |
103 | - 'file_id' => 'File', //Response from getFile |
|
104 | - 'username' => 'User', //Response from getMe |
|
105 | - 'id' => 'Chat', //Response from getChat |
|
106 | - 'user' => 'ChatMember', //Response from getChatMember |
|
107 | - 'url' => 'WebhookInfo', //Response from getWebhookInfo |
|
103 | + 'file_id' => 'File', //Response from getFile |
|
104 | + 'username' => 'User', //Response from getMe |
|
105 | + 'id' => 'Chat', //Response from getChat |
|
106 | + 'user' => 'ChatMember', //Response from getChatMember |
|
107 | + 'url' => 'WebhookInfo', //Response from getWebhookInfo |
|
108 | 108 | ]; |
109 | 109 | foreach ($result_object_types as $type => $object_class) { |
110 | 110 | if (isset($result[$type])) { |