@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | // Convert each Entity item into an object based on its JSON reflection |
| 293 | - $json_entities = array_map(function ($entity) { |
|
| 293 | + $json_entities = array_map(function($entity) { |
|
| 294 | 294 | return json_decode($entity, true); |
| 295 | 295 | }, $entities); |
| 296 | 296 | |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | if (null !== $select['text']) { |
| 1045 | 1045 | $text_like = '%' . strtolower($select['text']) . '%'; |
| 1046 | 1046 | if ($select['users']) { |
| 1047 | - $where[] = '( |
|
| 1047 | + $where[] = '( |
|
| 1048 | 1048 | LOWER(' . TB_CHAT . '.`title`) LIKE :text1 |
| 1049 | 1049 | OR LOWER(' . TB_USER . '.`first_name`) LIKE :text2 |
| 1050 | 1050 | OR LOWER(' . TB_USER . '.`last_name`) LIKE :text3 |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | $notes['state'] = 0; |
| 129 | 129 | $this->conversation->update(); |
| 130 | 130 | |
| 131 | - $keyboard = array_map(function ($channel) { |
|
| 131 | + $keyboard = array_map(function($channel) { |
|
| 132 | 132 | return [$channel]; |
| 133 | 133 | }, $channels); |
| 134 | 134 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | /** @var ServerResponse[] $results */ |
| 63 | 63 | $results = Request::sendToActiveChats( |
| 64 | - 'sendMessage', //callback function to execute (see Request.php methods) |
|
| 64 | + 'sendMessage', //callback function to execute (see Request.php methods) |
|
| 65 | 65 | ['text' => $text], //Param to evaluate the request |
| 66 | 66 | [ |
| 67 | 67 | 'groups' => true, |
@@ -281,7 +281,7 @@ |
||
| 281 | 281 | { |
| 282 | 282 | // Get the correct logger instance. |
| 283 | 283 | $logger = null; |
| 284 | - if (in_array($name, ['emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug',], true)) { |
|
| 284 | + if (in_array($name, ['emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', ], true)) { |
|
| 285 | 285 | $logger = self::$logger; |
| 286 | 286 | } elseif ($name === 'update') { |
| 287 | 287 | $logger = self::$update_logger; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | if ($these_photos = $this->getProperty('photos')) { |
| 44 | 44 | foreach ($these_photos as $photos) { |
| 45 | - $all_photos[] = array_map(function ($photo) { |
|
| 45 | + $all_photos[] = array_map(function($photo) { |
|
| 46 | 46 | return new PhotoSize($photo); |
| 47 | 47 | }, $photos); |
| 48 | 48 | } |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | // Convert numeric-only values to days. |
| 125 | - array_walk($clean_older_than, function (&$time) use ($custom_time) { |
|
| 125 | + array_walk($clean_older_than, function(&$time) use ($custom_time) { |
|
| 126 | 126 | if (!empty($custom_time)) { |
| 127 | 127 | $time = $custom_time; |
| 128 | 128 | } |
@@ -200,8 +200,8 @@ |
||
| 200 | 200 | public static function escapeMarkdown(string $string): string |
| 201 | 201 | { |
| 202 | 202 | return str_replace( |
| 203 | - ['[', '`', '*', '_',], |
|
| 204 | - ['\[', '\`', '\*', '\_',], |
|
| 203 | + ['[', '`', '*', '_', ], |
|
| 204 | + ['\[', '\`', '\*', '\_', ], |
|
| 205 | 205 | $string |
| 206 | 206 | ); |
| 207 | 207 | } |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | 'first_name' => 'botname', |
| 335 | 335 | 'username' => 'namebot', |
| 336 | 336 | ]; |
| 337 | - $data['chat'] = ['id' => $data['chat_id']]; |
|
| 337 | + $data['chat'] = ['id' => $data['chat_id']]; |
|
| 338 | 338 | |
| 339 | 339 | $fake_response['result'] = $data; |
| 340 | 340 | } |
@@ -870,9 +870,9 @@ discard block |
||
| 870 | 870 | // Make sure we're handling integers here. |
| 871 | 871 | $requests = array_map('intval', $requests); |
| 872 | 872 | |
| 873 | - $chat_per_second = ($requests['LIMIT_PER_SEC'] === 0); // No more than one message per second inside a particular chat |
|
| 873 | + $chat_per_second = ($requests['LIMIT_PER_SEC'] === 0); // No more than one message per second inside a particular chat |
|
| 874 | 874 | $global_per_second = ($requests['LIMIT_PER_SEC_ALL'] < 30); // No more than 30 messages per second to different chats |
| 875 | - $groups_per_minute = (((is_numeric($chat_id) && $chat_id > 0) || $inline_message_id !== null) || ((!is_numeric($chat_id) || $chat_id < 0) && $requests['LIMIT_PER_MINUTE'] < 20)); // No more than 20 messages per minute in groups and channels |
|
| 875 | + $groups_per_minute = (((is_numeric($chat_id) && $chat_id > 0) || $inline_message_id !== null) || ((!is_numeric($chat_id) || $chat_id < 0) && $requests['LIMIT_PER_MINUTE'] < 20)); // No more than 20 messages per minute in groups and channels |
|
| 876 | 876 | |
| 877 | 877 | if ($chat_per_second && $global_per_second && $groups_per_minute) { |
| 878 | 878 | break; |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | throw new TelegramException('Hook url is empty!'); |
| 901 | 901 | } |
| 902 | 902 | |
| 903 | - $data = array_intersect_key($data, array_flip([ |
|
| 903 | + $data = array_intersect_key($data, array_flip([ |
|
| 904 | 904 | 'certificate', |
| 905 | 905 | 'max_connections', |
| 906 | 906 | 'allowed_updates', |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | // Give bot access to admin commands |
| 1017 | 1017 | $this->enableAdmin($bot_id); |
| 1018 | 1018 | |
| 1019 | - $newUpdate = static function ($text = '') use ($bot_id, $bot_name, $bot_username) { |
|
| 1019 | + $newUpdate = static function($text = '') use ($bot_id, $bot_name, $bot_username) { |
|
| 1020 | 1020 | return new Update([ |
| 1021 | 1021 | 'update_id' => 0, |
| 1022 | 1022 | 'message' => [ |