@@ -45,19 +45,19 @@ discard block |
||
45 | 45 | $keyboards = []; |
46 | 46 | |
47 | 47 | //0 |
48 | - $keyboard[] = ['7','8','9']; |
|
49 | - $keyboard[] = ['4','5','6']; |
|
50 | - $keyboard[] = ['1','2','3']; |
|
51 | - $keyboard[] = [' ','0',' ']; |
|
48 | + $keyboard[] = ['7', '8', '9']; |
|
49 | + $keyboard[] = ['4', '5', '6']; |
|
50 | + $keyboard[] = ['1', '2', '3']; |
|
51 | + $keyboard[] = [' ', '0', ' ']; |
|
52 | 52 | |
53 | 53 | $keyboards[] = $keyboard; |
54 | 54 | unset($keyboard); |
55 | 55 | |
56 | 56 | //1 |
57 | - $keyboard[] = ['7','8','9','+']; |
|
58 | - $keyboard[] = ['4','5','6','-']; |
|
59 | - $keyboard[] = ['1','2','3','*']; |
|
60 | - $keyboard[] = [' ','0',' ','/']; |
|
57 | + $keyboard[] = ['7', '8', '9', '+']; |
|
58 | + $keyboard[] = ['4', '5', '6', '-']; |
|
59 | + $keyboard[] = ['1', '2', '3', '*']; |
|
60 | + $keyboard[] = [' ', '0', ' ', '/']; |
|
61 | 61 | |
62 | 62 | $keyboards[] = $keyboard; |
63 | 63 | unset($keyboard); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | //3 |
74 | 74 | $keyboard[] = ['A']; |
75 | 75 | $keyboard[] = ['B']; |
76 | - $keyboard[] = ['C','D']; |
|
76 | + $keyboard[] = ['C', 'D']; |
|
77 | 77 | |
78 | 78 | $keyboards[] = $keyboard; |
79 | 79 | unset($keyboard); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $data['reply_markup'] = new ReplyKeyboardMarkup( |
97 | 97 | [ |
98 | - 'keyboard' => $keyboards[1] , |
|
98 | + 'keyboard' => $keyboards[1], |
|
99 | 99 | 'resize_keyboard' => true, |
100 | 100 | 'one_time_keyboard' => false, |
101 | 101 | 'selective' => false |
@@ -21,10 +21,10 @@ |
||
21 | 21 | |
22 | 22 | // Enter your MySQL database credentials |
23 | 23 | $mysql_credentials = [ |
24 | - 'host' => 'localhost', |
|
25 | - 'user' => 'dbuser', |
|
26 | - 'password' => 'dbpass', |
|
27 | - 'database' => 'dbname', |
|
24 | + 'host' => 'localhost', |
|
25 | + 'user' => 'dbuser', |
|
26 | + 'password' => 'dbpass', |
|
27 | + 'database' => 'dbname', |
|
28 | 28 | ]; |
29 | 29 | |
30 | 30 | try { |
@@ -47,16 +47,16 @@ |
||
47 | 47 | |
48 | 48 | public function getDuration() |
49 | 49 | { |
50 | - return $this->duration; |
|
50 | + return $this->duration; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function getMimeType() |
54 | 54 | { |
55 | - return $this->mime_type; |
|
55 | + return $this->mime_type; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public function getFileSize() |
59 | 59 | { |
60 | - return $this->file_size; |
|
60 | + return $this->file_size; |
|
61 | 61 | } |
62 | 62 | } |
@@ -720,7 +720,7 @@ |
||
720 | 720 | /** |
721 | 721 | * Unset Webhook for bot |
722 | 722 | * |
723 | - * @return mixed |
|
723 | + * @return Entities\ServerResponse |
|
724 | 724 | * @throws \Longman\TelegramBot\Exception\TelegramException |
725 | 725 | */ |
726 | 726 | public function unsetWebHook() |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | { |
289 | 289 | if (!DB::isDbConnected()) { |
290 | 290 | return new Entities\ServerResponse([ |
291 | - 'ok' => false, |
|
292 | - 'description' => 'getUpdates needs MySQL connection!', |
|
293 | - ], $this->bot_name); |
|
291 | + 'ok' => false, |
|
292 | + 'description' => 'getUpdates needs MySQL connection!', |
|
293 | + ], $this->bot_name); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | //DB Query |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | return mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding) . mb_strtolower(mb_substr($str, 1, |
763 | 763 | mb_strlen($str), |
764 | 764 | $encoding), |
765 | - $encoding); |
|
765 | + $encoding); |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | /** |
@@ -307,7 +307,7 @@ |
||
307 | 307 | |
308 | 308 | if ($response->isOk()) { |
309 | 309 | //Process all updates |
310 | - foreach ((array)$response->getResult() as $result) { |
|
310 | + foreach ((array) $response->getResult() as $result) { |
|
311 | 311 | $this->processUpdate($result); |
312 | 312 | } |
313 | 313 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | try { |
87 | - $sth = self::$pdo->prepare('INSERT INTO `' . TB_CONVERSATION . '` |
|
87 | + $sth = self::$pdo->prepare('INSERT INTO `' . TB_CONVERSATION . '` |
|
88 | 88 | ( |
89 | 89 | `status`, `user_id`, `chat_id`, `command`, `notes`, `created_at`, `updated_at` |
90 | 90 | ) |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $sth_insert_telegram_update->bindParam(':message_id', $message_id, PDO::PARAM_INT); |
298 | 298 | $sth_insert_telegram_update->bindParam(':inline_query_id', $inline_query_id, PDO::PARAM_INT); |
299 | 299 | $sth_insert_telegram_update->bindParam(':chosen_inline_result_id', $chosen_inline_result_id, |
300 | - PDO::PARAM_INT); |
|
300 | + PDO::PARAM_INT); |
|
301 | 301 | $sth_insert_telegram_update->bindParam(':callback_query_id', $callback_query_id, PDO::PARAM_INT); |
302 | 302 | $sth_insert_telegram_update->bindParam(':edited_message_id', $edited_message_id, PDO::PARAM_INT); |
303 | 303 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | if (self::insertChosenInlineResultRequest($chosen_inline_result)) { |
460 | 460 | $chosen_inline_result_local_id = self::$pdo->lastInsertId(); |
461 | 461 | return self::insertTelegramUpdate($update_id, null, null, null, $chosen_inline_result_local_id, null, |
462 | - null); |
|
462 | + null); |
|
463 | 463 | } |
464 | 464 | } elseif ($update->getUpdateType() == 'callback_query') { |
465 | 465 | $callback_query = $update->getCallbackQuery(); |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $chat_id = $edited_message->getChat()->getId(); |
476 | 476 | $edited_message_local_id = self::$pdo->lastInsertId(); |
477 | 477 | return self::insertTelegramUpdate($update_id, $chat_id, null, null, null, null, |
478 | - $edited_message_local_id); |
|
478 | + $edited_message_local_id); |
|
479 | 479 | } |
480 | 480 | } |
481 | 481 |