@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Longman\TelegramBot\Conversation; |
| 15 | 15 | use Longman\TelegramBot\Commands\AdminCommand; |
| 16 | 16 | use Longman\TelegramBot\Entities\Message; |
| 17 | -use Longman\TelegramBot\Entities\ReplyKeyboardHide; |
|
| 18 | 17 | use Longman\TelegramBot\Entities\ReplyKeyboardMarkup; |
| 19 | 18 | use Longman\TelegramBot\Exception\TelegramException; |
| 20 | 19 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->conversation = new Conversation($user_id, $chat_id, $this->getName()); |
| 81 | 81 | $notes = &$this->conversation->notes; |
| 82 | 82 | |
| 83 | - $channels = (array)$this->getConfig('your_channel'); |
|
| 83 | + $channels = (array) $this->getConfig('your_channel'); |
|
| 84 | 84 | if (isset($notes['state'])) { |
| 85 | 85 | $state = $notes['state']; |
| 86 | 86 | } else { |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | ]; |
| 345 | 345 | |
| 346 | 346 | if ($text !== '') { |
| 347 | - $channels = (array)$this->getConfig('your_channel'); |
|
| 347 | + $channels = (array) $this->getConfig('your_channel'); |
|
| 348 | 348 | $first_channel = $channels[0]; |
| 349 | 349 | $data['text'] = $this->publish( |
| 350 | 350 | new Message($message->reflect(), $this->telegram->getBotName()), |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | /** |
| 46 | 46 | * Reflect |
| 47 | 47 | * |
| 48 | - * @param null $object |
|
| 48 | + * @param Entity $object |
|
| 49 | 49 | * @return array |
| 50 | 50 | */ |
| 51 | 51 | public function reflect($object = null) |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | /** |
| 476 | 476 | * Get date |
| 477 | 477 | * |
| 478 | - * @return mixed |
|
| 478 | + * @return integer|null |
|
| 479 | 479 | */ |
| 480 | 480 | public function getDate() |
| 481 | 481 | { |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | /** |
| 516 | 516 | * Get forward date |
| 517 | 517 | * |
| 518 | - * @return mixed |
|
| 518 | + * @return integer|null |
|
| 519 | 519 | */ |
| 520 | 520 | public function getForwardDate() |
| 521 | 521 | { |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | /** |
| 526 | 526 | * Get edit date |
| 527 | 527 | * |
| 528 | - * @return mixed |
|
| 528 | + * @return integer|null |
|
| 529 | 529 | */ |
| 530 | 530 | public function getEditDate() |
| 531 | 531 | { |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | /** |
| 667 | 667 | * Get new chat participant |
| 668 | 668 | * |
| 669 | - * @return mixed |
|
| 669 | + * @return User|null |
|
| 670 | 670 | */ |
| 671 | 671 | public function getNewChatParticipant() |
| 672 | 672 | { |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | /** |
| 677 | 677 | * Get left chat participant |
| 678 | 678 | * |
| 679 | - * @return mixed |
|
| 679 | + * @return User|null |
|
| 680 | 680 | */ |
| 681 | 681 | public function getLeftChatParticipant() |
| 682 | 682 | { |
@@ -296,7 +296,7 @@ |
||
| 296 | 296 | $this->type = 'Voice'; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | - $this->caption = isset($data['caption']) ? $data['caption'] : null;//string |
|
| 299 | + $this->caption = isset($data['caption']) ? $data['caption'] : null; //string |
|
| 300 | 300 | |
| 301 | 301 | $this->contact = isset($data['contact']) ? $data['contact'] : null; |
| 302 | 302 | if (!empty($this->contact)) { |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * ServerResponse constructor. |
| 35 | 35 | * |
| 36 | 36 | * @param array $data |
| 37 | - * @param $bot_name |
|
| 37 | + * @param string|null $bot_name |
|
| 38 | 38 | */ |
| 39 | 39 | public function __construct(array $data, $bot_name) |
| 40 | 40 | { |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | /** |
| 103 | 103 | * Get update id |
| 104 | 104 | * |
| 105 | - * @return mixed|null |
|
| 105 | + * @return integer |
|
| 106 | 106 | */ |
| 107 | 107 | public function getUpdateId() |
| 108 | 108 | { |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * @param string $action Action to execute |
| 168 | 168 | * @param array|null $data Data to attach to the execution |
| 169 | 169 | * |
| 170 | - * @return mixed Result of the HTTP Request |
|
| 170 | + * @return \Psr\Http\Message\StreamInterface Result of the HTTP Request |
|
| 171 | 171 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 172 | 172 | */ |
| 173 | 173 | public static function execute($action, array $data = null) |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | /** |
| 312 | 312 | * Get me |
| 313 | 313 | * |
| 314 | - * @return mixed |
|
| 314 | + * @return ServerResponse |
|
| 315 | 315 | */ |
| 316 | 316 | public static function getMe() |
| 317 | 317 | { |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | * |
| 352 | 352 | * @param array $data |
| 353 | 353 | * |
| 354 | - * @return mixed |
|
| 354 | + * @return ServerResponse |
|
| 355 | 355 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 356 | 356 | */ |
| 357 | 357 | public static function forwardMessage(array $data) |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | * @param array $data |
| 370 | 370 | * @param string $file |
| 371 | 371 | * |
| 372 | - * @return mixed |
|
| 372 | + * @return ServerResponse |
|
| 373 | 373 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 374 | 374 | */ |
| 375 | 375 | public static function sendPhoto(array $data, $file = null) |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | * @param array $data |
| 392 | 392 | * @param string $file |
| 393 | 393 | * |
| 394 | - * @return mixed |
|
| 394 | + * @return ServerResponse |
|
| 395 | 395 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 396 | 396 | */ |
| 397 | 397 | public static function sendAudio(array $data, $file = null) |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | * @param array $data |
| 414 | 414 | * @param string $file |
| 415 | 415 | * |
| 416 | - * @return mixed |
|
| 416 | + * @return ServerResponse |
|
| 417 | 417 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 418 | 418 | */ |
| 419 | 419 | public static function sendDocument(array $data, $file = null) |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | * @param array $data |
| 436 | 436 | * @param string $file |
| 437 | 437 | * |
| 438 | - * @return mixed |
|
| 438 | + * @return ServerResponse |
|
| 439 | 439 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 440 | 440 | */ |
| 441 | 441 | public static function sendSticker(array $data, $file = null) |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | * @param array $data |
| 458 | 458 | * @param string $file |
| 459 | 459 | * |
| 460 | - * @return mixed |
|
| 460 | + * @return ServerResponse |
|
| 461 | 461 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 462 | 462 | */ |
| 463 | 463 | public static function sendVideo(array $data, $file = null) |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | * @param array $data |
| 480 | 480 | * @param string $file |
| 481 | 481 | * |
| 482 | - * @return mixed |
|
| 482 | + * @return ServerResponse |
|
| 483 | 483 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 484 | 484 | */ |
| 485 | 485 | public static function sendVoice(array $data, $file = null) |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | * |
| 501 | 501 | * @param array $data |
| 502 | 502 | * |
| 503 | - * @return mixed |
|
| 503 | + * @return ServerResponse |
|
| 504 | 504 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 505 | 505 | */ |
| 506 | 506 | public static function sendLocation(array $data) |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | * |
| 518 | 518 | * @param array $data |
| 519 | 519 | * |
| 520 | - * @return mixed |
|
| 520 | + * @return ServerResponse |
|
| 521 | 521 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 522 | 522 | */ |
| 523 | 523 | public static function sendVenue(array $data) |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | * |
| 535 | 535 | * @param array $data |
| 536 | 536 | * |
| 537 | - * @return mixed |
|
| 537 | + * @return ServerResponse |
|
| 538 | 538 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 539 | 539 | */ |
| 540 | 540 | public static function sendContact(array $data) |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | * |
| 552 | 552 | * @param array $data |
| 553 | 553 | * |
| 554 | - * @return mixed |
|
| 554 | + * @return ServerResponse |
|
| 555 | 555 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 556 | 556 | */ |
| 557 | 557 | public static function sendChatAction(array $data) |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | * |
| 569 | 569 | * @param array $data |
| 570 | 570 | * |
| 571 | - * @return mixed |
|
| 571 | + * @return ServerResponse |
|
| 572 | 572 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 573 | 573 | */ |
| 574 | 574 | public static function getUserProfilePhotos(array $data) |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | * |
| 590 | 590 | * @param array $data |
| 591 | 591 | * |
| 592 | - * @return mixed |
|
| 592 | + * @return ServerResponse |
|
| 593 | 593 | */ |
| 594 | 594 | public static function getUpdates(array $data) |
| 595 | 595 | { |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | * @param string $url |
| 603 | 603 | * @param string $file |
| 604 | 604 | * |
| 605 | - * @return mixed |
|
| 605 | + * @return ServerResponse |
|
| 606 | 606 | */ |
| 607 | 607 | public static function setWebhook($url = '', $file = null) |
| 608 | 608 | { |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | * |
| 621 | 621 | * @param array $data |
| 622 | 622 | * |
| 623 | - * @return mixed |
|
| 623 | + * @return ServerResponse |
|
| 624 | 624 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 625 | 625 | */ |
| 626 | 626 | public static function getFile(array $data) |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | * |
| 638 | 638 | * @param array $data |
| 639 | 639 | * |
| 640 | - * @return mixed |
|
| 640 | + * @return ServerResponse |
|
| 641 | 641 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 642 | 642 | */ |
| 643 | 643 | public static function kickChatMember(array $data) |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | * |
| 655 | 655 | * @param array $data |
| 656 | 656 | * |
| 657 | - * @return mixed |
|
| 657 | + * @return ServerResponse |
|
| 658 | 658 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 659 | 659 | */ |
| 660 | 660 | public static function leaveChat(array $data) |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | * |
| 672 | 672 | * @param array $data |
| 673 | 673 | * |
| 674 | - * @return mixed |
|
| 674 | + * @return ServerResponse |
|
| 675 | 675 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 676 | 676 | */ |
| 677 | 677 | public static function unbanChatMember(array $data) |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | * |
| 691 | 691 | * @param array $data |
| 692 | 692 | * |
| 693 | - * @return mixed |
|
| 693 | + * @return ServerResponse |
|
| 694 | 694 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 695 | 695 | */ |
| 696 | 696 | public static function getChat(array $data) |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | * |
| 710 | 710 | * @param array $data |
| 711 | 711 | * |
| 712 | - * @return mixed |
|
| 712 | + * @return ServerResponse |
|
| 713 | 713 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 714 | 714 | */ |
| 715 | 715 | public static function getChatAdministrators(array $data) |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | * |
| 729 | 729 | * @param array $data |
| 730 | 730 | * |
| 731 | - * @return mixed |
|
| 731 | + * @return ServerResponse |
|
| 732 | 732 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 733 | 733 | */ |
| 734 | 734 | public static function getChatMembersCount(array $data) |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | * |
| 748 | 748 | * @param array $data |
| 749 | 749 | * |
| 750 | - * @return mixed |
|
| 750 | + * @return ServerResponse |
|
| 751 | 751 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 752 | 752 | */ |
| 753 | 753 | public static function getChatMember(array $data) |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | * |
| 765 | 765 | * @param array $data |
| 766 | 766 | * |
| 767 | - * @return mixed |
|
| 767 | + * @return ServerResponse |
|
| 768 | 768 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 769 | 769 | */ |
| 770 | 770 | public static function answerCallbackQuery(array $data) |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | * |
| 782 | 782 | * @param array $data |
| 783 | 783 | * |
| 784 | - * @return mixed |
|
| 784 | + * @return ServerResponse |
|
| 785 | 785 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 786 | 786 | */ |
| 787 | 787 | public static function answerInlineQuery(array $data) |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | * |
| 799 | 799 | * @param array $data |
| 800 | 800 | * |
| 801 | - * @return mixed |
|
| 801 | + * @return ServerResponse |
|
| 802 | 802 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 803 | 803 | */ |
| 804 | 804 | public static function editMessageText(array $data) |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | * |
| 816 | 816 | * @param array $data |
| 817 | 817 | * |
| 818 | - * @return mixed |
|
| 818 | + * @return ServerResponse |
|
| 819 | 819 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 820 | 820 | */ |
| 821 | 821 | public static function editMessageCaption(array $data) |
@@ -832,7 +832,7 @@ discard block |
||
| 832 | 832 | * |
| 833 | 833 | * @param array $data |
| 834 | 834 | * |
| 835 | - * @return mixed |
|
| 835 | + * @return ServerResponse |
|
| 836 | 836 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 837 | 837 | */ |
| 838 | 838 | public static function editMessageReplyMarkup(array $data) |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | 'first_name' => 'botname', |
| 154 | 154 | 'username' => 'namebot', |
| 155 | 155 | ]; |
| 156 | - $data['chat'] = ['id' => $data['chat_id']]; |
|
| 156 | + $data['chat'] = ['id' => $data['chat_id']]; |
|
| 157 | 157 | |
| 158 | 158 | $fake_response['result'] = $data; |
| 159 | 159 | } |
@@ -729,7 +729,7 @@ |
||
| 729 | 729 | /** |
| 730 | 730 | * Unset Webhook for bot |
| 731 | 731 | * |
| 732 | - * @return mixed |
|
| 732 | + * @return ServerResponse |
|
| 733 | 733 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 734 | 734 | */ |
| 735 | 735 | public function unsetWebHook() |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require __DIR__ . '/../vendor/autoload.php'; |
| 3 | 3 | |
| 4 | -$filename='logfile.log'; |
|
| 4 | +$filename = 'logfile.log'; |
|
| 5 | 5 | $API_KEY = 'random'; |
| 6 | 6 | $BOT_NAME = 'bot_name'; |
| 7 | 7 | |
@@ -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 { |