@@ -101,7 +101,7 @@ |
||
| 101 | 101 | /** |
| 102 | 102 | * Get the services provided by the provider. |
| 103 | 103 | * |
| 104 | - * @return array |
|
| 104 | + * @return string[] |
|
| 105 | 105 | */ |
| 106 | 106 | public function provides() |
| 107 | 107 | { |
@@ -2,12 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Telegram\Bot\Laravel; |
| 4 | 4 | |
| 5 | -use Telegram\Bot\Api; |
|
| 6 | -use Telegram\Bot\BotsManager; |
|
| 7 | -use Illuminate\Support\ServiceProvider; |
|
| 8 | 5 | use Illuminate\Contracts\Foundation\Application; |
| 9 | -use Laravel\Lumen\Application as LumenApplication; |
|
| 10 | 6 | use Illuminate\Foundation\Application as LaravelApplication; |
| 7 | +use Illuminate\Support\ServiceProvider; |
|
| 8 | +use Laravel\Lumen\Application as LumenApplication; |
|
| 9 | +use Telegram\Bot\Api; |
|
| 10 | +use Telegram\Bot\BotsManager; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Class TelegramServiceProvider. |
@@ -8,13 +8,13 @@ |
||
| 8 | 8 | use Telegram\Bot\FileUpload\InputFile; |
| 9 | 9 | use Telegram\Bot\HttpClients\GuzzleHttpClient; |
| 10 | 10 | use Telegram\Bot\HttpClients\HttpClientInterface; |
| 11 | +use Telegram\Bot\Keyboard\Keyboard; |
|
| 11 | 12 | use Telegram\Bot\Objects\File; |
| 12 | 13 | use Telegram\Bot\Objects\Message; |
| 13 | 14 | use Telegram\Bot\Objects\UnknownObject; |
| 14 | 15 | use Telegram\Bot\Objects\Update; |
| 15 | 16 | use Telegram\Bot\Objects\User; |
| 16 | 17 | use Telegram\Bot\Objects\UserProfilePhotos; |
| 17 | -use Telegram\Bot\Keyboard\Keyboard; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Class Api. |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | * @var bool $params ['disable_web_page_preview'] |
| 810 | 810 | * @var string $params ['reply_markup'] |
| 811 | 811 | * |
| 812 | - * @return TelegramResponse |
|
| 812 | + * @return Message |
|
| 813 | 813 | */ |
| 814 | 814 | public function editMessageText(array $params) |
| 815 | 815 | { |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | * @var string $params ['caption'] |
| 842 | 842 | * @var string $params ['reply_markup'] |
| 843 | 843 | * |
| 844 | - * @return TelegramResponse |
|
| 844 | + * @return Message |
|
| 845 | 845 | */ |
| 846 | 846 | public function editMessageCaption(array $params) |
| 847 | 847 | { |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | * @var string $params ['inline_message_id'] |
| 872 | 872 | * @var string $params ['reply_markup'] |
| 873 | 873 | * |
| 874 | - * @return TelegramResponse |
|
| 874 | + * @return Message |
|
| 875 | 875 | */ |
| 876 | 876 | public function editMessageReplyMarkup(array $params) |
| 877 | 877 | { |
@@ -907,7 +907,7 @@ discard block |
||
| 907 | 907 | * @var string|null $params ['switch_pm_text'] |
| 908 | 908 | * @var string|null $params ['switch_pm_parameter'] |
| 909 | 909 | * |
| 910 | - * @return bool |
|
| 910 | + * @return TelegramResponse |
|
| 911 | 911 | */ |
| 912 | 912 | public function answerInlineQuery(array $params = []) |
| 913 | 913 | { |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | * |
| 939 | 939 | * @throws TelegramSDKException |
| 940 | 940 | * |
| 941 | - * @return TelegramResponse |
|
| 941 | + * @return Message |
|
| 942 | 942 | */ |
| 943 | 943 | public function setWebhook(array $params) |
| 944 | 944 | { |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | * @var bool $params ['one_time_keyboard'] |
| 1055 | 1055 | * @var bool $params ['selective'] |
| 1056 | 1056 | * |
| 1057 | - * @return string |
|
| 1057 | + * @return Keyboard |
|
| 1058 | 1058 | */ |
| 1059 | 1059 | public function replyKeyboardMarkup(array $params) |
| 1060 | 1060 | { |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | * @var bool $params ['hide_keyboard'] |
| 1082 | 1082 | * @var bool $params ['selective'] |
| 1083 | 1083 | * |
| 1084 | - * @return string |
|
| 1084 | + * @return Keyboard |
|
| 1085 | 1085 | */ |
| 1086 | 1086 | public static function replyKeyboardHide(array $params = []) |
| 1087 | 1087 | { |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | * @var bool $params ['force_reply'] |
| 1109 | 1109 | * @var bool $params ['selective'] |
| 1110 | 1110 | * |
| 1111 | - * @return string |
|
| 1111 | + * @return Keyboard |
|
| 1112 | 1112 | */ |
| 1113 | 1113 | public static function forceReply(array $params = []) |
| 1114 | 1114 | { |
@@ -1188,7 +1188,7 @@ discard block |
||
| 1188 | 1188 | * |
| 1189 | 1189 | * @throws \InvalidArgumentException |
| 1190 | 1190 | * |
| 1191 | - * @return bool |
|
| 1191 | + * @return null|boolean |
|
| 1192 | 1192 | */ |
| 1193 | 1193 | public function isMessageType($type, $object) |
| 1194 | 1194 | { |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | * Used primarily for file uploads. |
| 1294 | 1294 | * |
| 1295 | 1295 | * @param string $endpoint |
| 1296 | - * @param array $params |
|
| 1296 | + * @param string $params |
|
| 1297 | 1297 | * |
| 1298 | 1298 | * @throws TelegramSDKException |
| 1299 | 1299 | * |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @param $line |
| 159 | 159 | * @param $replace |
| 160 | - * @param $delimiter |
|
| 160 | + * @param string $delimiter |
|
| 161 | 161 | * |
| 162 | 162 | * @return mixed |
| 163 | 163 | */ |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * |
| 176 | 176 | * @param $line |
| 177 | 177 | * @param $replace |
| 178 | - * @param $delimiter |
|
| 178 | + * @param string $delimiter |
|
| 179 | 179 | * |
| 180 | 180 | * @return mixed |
| 181 | 181 | */ |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | private $eventEmitter; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * @param EventInterface|string $event |
|
| 16 | + * @param UpdateWasReceived $event |
|
| 17 | 17 | * @throws \InvalidArgumentException |
| 18 | 18 | * @return bool true if emitted, false otherwise |
| 19 | 19 | */ |
@@ -60,6 +60,9 @@ |
||
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | + /** |
|
| 64 | + * @param \Closure $listener |
|
| 65 | + */ |
|
| 63 | 66 | function addUpdateListener($listener){ |
| 64 | 67 | $this->getEventEmitter()->addListener(UpdateWasReceived::class, $listener); |
| 65 | 68 | } |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | use League\Event\Emitter; |
| 6 | 6 | use Telegram\Bot\Api; |
| 7 | -use Telegram\Bot\Events\UpdateWasReceived; |
|
| 8 | 7 | use Telegram\Bot\Events\EmitsEvents; |
| 8 | +use Telegram\Bot\Events\UpdateWasReceived; |
|
| 9 | 9 | |
| 10 | 10 | class Bot{ |
| 11 | 11 | |
@@ -155,6 +155,7 @@ |
||
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | 157 | * {@inheritdoc} |
| 158 | + * @param string $arguments |
|
| 158 | 159 | */ |
| 159 | 160 | abstract public function handle($arguments); |
| 160 | 161 | } |
@@ -23,7 +23,6 @@ |
||
| 23 | 23 | * UpdateWasReceived constructor. |
| 24 | 24 | * |
| 25 | 25 | * @param Update $update |
| 26 | - * @param Api $telegram |
|
| 27 | 26 | */ |
| 28 | 27 | public function __construct(Update $update, Bot $bot) |
| 29 | 28 | { |