@@ -19,11 +19,11 @@ |
||
19 | 19 | $this->gifFileId ?? $this->mpeg4FileId ?? $this->photoFileId ?? $this->stickerFileId ?? $this->videoFileId ?? |
20 | 20 | $this->voiceFileId ?? $this->fileId; |
21 | 21 | return $this->api->getFile($fileId)->then( |
22 | - function (File $file) { |
|
22 | + function(File $file) { |
|
23 | 23 | return $this->api->downloadFile($file->filePath); |
24 | 24 | } |
25 | 25 | )->then( |
26 | - function (StreamInterface $stream) use ($path) { |
|
26 | + function(StreamInterface $stream) use ($path) { |
|
27 | 27 | return file_put_contents($path, $stream); |
28 | 28 | } |
29 | 29 | ); |
@@ -18,11 +18,11 @@ |
||
18 | 18 | ?int $cacheTime = null |
19 | 19 | ): PromiseInterface { |
20 | 20 | return $this->api->answerCallbackQuery( |
21 | - callbackQueryId: $this->id, |
|
22 | - text: $text, |
|
23 | - showAlert: $showAlert, |
|
24 | - url: $url, |
|
25 | - cacheTime: $cacheTime |
|
21 | + callbackQueryId : $this->id, |
|
22 | + text : $text, |
|
23 | + showAlert : $showAlert, |
|
24 | + url : $url, |
|
25 | + cacheTime : $cacheTime |
|
26 | 26 | ); |
27 | 27 | } |
28 | 28 |
@@ -67,25 +67,25 @@ |
||
67 | 67 | public function editMedia(InputMedia $media, ?InlineKeyboardMarkup $replyMarkup = null): PromiseInterface |
68 | 68 | { |
69 | 69 | return $this->api->editMessageMedia( |
70 | - media: $media, |
|
71 | - chatId: $this->chat->id, |
|
72 | - messageId: $this->messageId, |
|
73 | - replyMarkup: $replyMarkup |
|
70 | + media : $media, |
|
71 | + chatId : $this->chat->id, |
|
72 | + messageId : $this->messageId, |
|
73 | + replyMarkup : $replyMarkup |
|
74 | 74 | ); |
75 | 75 | } |
76 | 76 | |
77 | 77 | public function editReplyMarkup(?InlineKeyboardMarkup $replyMarkup = null): PromiseInterface |
78 | 78 | { |
79 | 79 | return $this->api->editMessageReplyMarkup( |
80 | - chatId: $this->chat->id, |
|
81 | - messageId: $this->messageId, |
|
82 | - replyMarkup: $replyMarkup |
|
80 | + chatId : $this->chat->id, |
|
81 | + messageId : $this->messageId, |
|
82 | + replyMarkup : $replyMarkup |
|
83 | 83 | ); |
84 | 84 | } |
85 | 85 | |
86 | 86 | public function stopPoll(?InlineKeyboardMarkup $replyMarkup = null): PromiseInterface |
87 | 87 | { |
88 | - return $this->api->stopPoll(chatId: $this->chat->id, messageId: $this->messageId, replyMarkup: $replyMarkup); |
|
88 | + return $this->api->stopPoll(chatId : $this->chat->id, messageId : $this->messageId, replyMarkup : $replyMarkup); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | } |
92 | 92 | \ No newline at end of file |
@@ -15,10 +15,10 @@ |
||
15 | 15 | public function edit(int|string $chatId, ?int $expireDate = null, ?int $memberLimit = null): PromiseInterface |
16 | 16 | { |
17 | 17 | return $this->api->editChatInviteLink( |
18 | - chatId: $chatId, |
|
19 | - inviteLink: $this->inviteLink, |
|
20 | - expireDate: $expireDate, |
|
21 | - memberLimit: $memberLimit |
|
18 | + chatId : $chatId, |
|
19 | + inviteLink : $this->inviteLink, |
|
20 | + expireDate : $expireDate, |
|
21 | + memberLimit : $memberLimit |
|
22 | 22 | ); |
23 | 23 | } |
24 | 24 |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | $client = $this->client; |
24 | 24 | $uri = sprintf('/file/bot%s/%s', $this->token, $remotePath); |
25 | 25 | return $client->getAsync($uri)->then( |
26 | - function (ResponseInterface $response) { |
|
26 | + function(ResponseInterface $response) { |
|
27 | 27 | return $response->getBody(); |
28 | 28 | }, |
29 | - function (RequestException $e) { |
|
29 | + function(RequestException $e) { |
|
30 | 30 | $message = sprintf( |
31 | 31 | 'An unknown error occurred when trying to fetch the file (%s): %s', |
32 | 32 | $e->getCode(), |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | if (!$e->hasResponse()) { |
36 | 36 | throw new TelegramAPIException($message); |
37 | 37 | } |
38 | - $data = json_decode($e->getResponse()?->getBody()); |
|
38 | + $data = json_decode($e->getResponse() ? ->getBody()); |
|
39 | 39 | if (empty($data)) { |
40 | 40 | throw new TelegramAPIException($message); |
41 | 41 | } |
42 | - match ($data->error_code) { |
|
42 | + match($data->error_code) { |
|
43 | 43 | 400 => throw new TelegramBadRequestException($data->description), |
44 | 44 | 401 => throw new TelegramUnauthorizedException('Token invalid or expired'), |
45 | 45 | 403 => throw new TelegramForbiddenException($data->description), |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | private function buildMultipartArgs(array $args): array |
104 | 104 | { |
105 | 105 | $result = []; |
106 | - $cleanInputMedia = function () { |
|
106 | + $cleanInputMedia = function() { |
|
107 | 107 | unset($this->inputMedia); |
108 | 108 | unset($this->multipart); |
109 | 109 | }; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | ); |
215 | 215 | $api = $this; |
216 | 216 | return $promise->then( |
217 | - function (ResponseInterface $webResponse) use ($api, $method) { |
|
217 | + function(ResponseInterface $webResponse) use ($api, $method) { |
|
218 | 218 | $data = json_decode($webResponse->getBody()); |
219 | 219 | $response = (new Response($api, $method)) |
220 | 220 | ->setOk($data->ok) |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | ->setErrorCode($data->error_code ?? null) |
223 | 223 | ->setDescription($data->description ?? null); |
224 | 224 | if (!$response->ok) { |
225 | - match ($response->errorCode) { |
|
225 | + match($response->errorCode) { |
|
226 | 226 | 400 => throw new TelegramBadRequestException($response->description), |
227 | 227 | 401 => throw new TelegramUnauthorizedException('Token invalid or expired'), |
228 | 228 | 403 => throw new TelegramForbiddenException($response->description), |
@@ -91,7 +91,7 @@ |
||
91 | 91 | { |
92 | 92 | $result = []; |
93 | 93 | foreach (self::TYPES_MAP as $flag => $type) { |
94 | - if ($types & $flag) { |
|
94 | + if ($types&$flag) { |
|
95 | 95 | $result[] = $type; |
96 | 96 | } |
97 | 97 | } |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | class BotCommandScopeDefault extends BotCommandScope |
6 | 6 | { |
7 | - /** @var string */ |
|
8 | - public string $type; |
|
7 | + /** @var string */ |
|
8 | + public string $type; |
|
9 | 9 | } |
@@ -4,12 +4,12 @@ |
||
4 | 4 | |
5 | 5 | class ForceReply implements TypeInterface |
6 | 6 | { |
7 | - /** @var bool */ |
|
8 | - public bool $forceReply; |
|
7 | + /** @var bool */ |
|
8 | + public bool $forceReply; |
|
9 | 9 | |
10 | 10 | /** @var string|null */ |
11 | 11 | public ?string $inputFieldPlaceholder = null; |
12 | 12 | |
13 | - /** @var bool|null */ |
|
14 | - public ?bool $selective = null; |
|
13 | + /** @var bool|null */ |
|
14 | + public ?bool $selective = null; |
|
15 | 15 | } |