@@ -84,14 +84,14 @@ |
||
| 84 | 84 | { |
| 85 | 85 | return $request->then( |
| 86 | 86 | // Promise fulfilled |
| 87 | - static function (ResponseInterface $response) { |
|
| 87 | + static function(ResponseInterface $response) { |
|
| 88 | 88 | return new TelegramResponse( |
| 89 | 89 | $response->getBody()->getContents(), |
| 90 | 90 | $response->getHeaders() |
| 91 | 91 | ); |
| 92 | 92 | }, |
| 93 | 93 | // Promise rejected |
| 94 | - static function (Exception $e) { |
|
| 94 | + static function(Exception $e) { |
|
| 95 | 95 | if ($e instanceof ResponseException) { |
| 96 | 96 | throw ClientException::fromResponseException($e); |
| 97 | 97 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $this->formType = 'multipart/form-data'; |
| 99 | 99 | foreach ($method->getLocalFiles() as $identifier => $localFile) { |
| 100 | 100 | if ($localFile instanceof InputFile) { |
| 101 | - $return[$identifier . '~' . $this->numberOfLocalFiles] = [ |
|
| 101 | + $return[$identifier.'~'.$this->numberOfLocalFiles] = [ |
|
| 102 | 102 | 'id' => $this->numberOfLocalFiles, |
| 103 | 103 | 'filename' => basename($localFile->path), |
| 104 | 104 | 'stream' => $localFile->getStream(), |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $body = $builder->buildAll(); |
| 125 | 125 | $completeRequest = [ |
| 126 | 126 | 'headers' => [ |
| 127 | - 'Content-Type' => 'multipart/form-data; boundary="' . $builder->getBoundary() . '"', |
|
| 127 | + 'Content-Type' => 'multipart/form-data; boundary="'.$builder->getBoundary().'"', |
|
| 128 | 128 | 'Content-Length' => strlen($body) |
| 129 | 129 | ], |
| 130 | 130 | 'body' => $body |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $this->requestHandler = $handler; |
| 72 | 72 | $this->formConstructor = new PostOptionsConstructor(); |
| 73 | - $this->apiUrl = 'https://api.telegram.org/bot' . $this->botToken . '/'; |
|
| 73 | + $this->apiUrl = 'https://api.telegram.org/bot'.$this->botToken.'/'; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | $this->resetObjectValues(); |
| 88 | 88 | $option = $this->formConstructor->constructOptions($method); |
| 89 | 89 | return $this->sendRequestToTelegram($method, $option) |
| 90 | - ->then(function (TelegramResponse $response) use ($method) { |
|
| 90 | + ->then(function(TelegramResponse $response) use ($method) { |
|
| 91 | 91 | return $method::bindToObject($response, $this->logger); |
| 92 | - }, function ($error) { |
|
| 92 | + }, function($error) { |
|
| 93 | 93 | $this->logger->error($error); |
| 94 | 94 | throw $error; |
| 95 | 95 | }); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->logger->debug('About to perform request to begin downloading file'); |
| 107 | 107 | |
| 108 | 108 | return $this->requestHandler->get($fileUrl)->then( |
| 109 | - function (TelegramResponse $rawData) { |
|
| 109 | + function(TelegramResponse $rawData) { |
|
| 110 | 110 | return new TelegramDocument($rawData); |
| 111 | 111 | } |
| 112 | 112 | ); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->methodName = substr($completeClassName, strrpos($completeClassName, '\\') + 1); |
| 155 | 155 | $this->logger->info('About to perform API request', ['method' => $this->methodName]); |
| 156 | 156 | |
| 157 | - return $this->apiUrl . $this->methodName; |
|
| 157 | + return $this->apiUrl.$this->methodName; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -165,6 +165,6 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function fileUrl(File $file): string |
| 167 | 167 | { |
| 168 | - return 'https://api.telegram.org/file/bot' . $this->botToken . '/' . $file->file_path; |
|
| 168 | + return 'https://api.telegram.org/file/bot'.$this->botToken.'/'.$file->file_path; |
|
| 169 | 169 | } |
| 170 | 170 | } |
@@ -95,15 +95,15 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public $forward_date = 0; |
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * Optional. True, if the message is sent to a forum topic |
|
| 100 | - */ |
|
| 101 | - public $is_topic_message = false; |
|
| 98 | + /** |
|
| 99 | + * Optional. True, if the message is sent to a forum topic |
|
| 100 | + */ |
|
| 101 | + public $is_topic_message = false; |
|
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * @var bool |
|
| 105 | - */ |
|
| 106 | - public $is_automatic_forward = false; |
|
| 103 | + /** |
|
| 104 | + * @var bool |
|
| 105 | + */ |
|
| 106 | + public $is_automatic_forward = false; |
|
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * Optional. For replies, the original message. Note that the Message object in this field will not contain further |
@@ -418,29 +418,29 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | public $proximity_alert_triggered; |
| 420 | 420 | |
| 421 | - /** |
|
| 422 | - * Optional. Service message: forum topic created |
|
| 423 | - * @var ForumTopicCreated |
|
| 424 | - */ |
|
| 425 | - public $forum_topic_created; |
|
| 426 | - |
|
| 427 | - /** |
|
| 428 | - * Optional. Service message: forum topic edited |
|
| 429 | - * @var ForumTopicEdited |
|
| 430 | - */ |
|
| 431 | - public $forum_topic_edited; |
|
| 432 | - |
|
| 433 | - /** |
|
| 434 | - * Optional. Service message: forum topic closed |
|
| 435 | - * @var ForumTopicClosed |
|
| 436 | - */ |
|
| 437 | - public $forum_topic_closed; |
|
| 438 | - |
|
| 439 | - /** |
|
| 440 | - * Optional. Service message: forum topic reopened |
|
| 441 | - * @var ForumTopicReopened |
|
| 442 | - */ |
|
| 443 | - public $forum_topic_reopened; |
|
| 421 | + /** |
|
| 422 | + * Optional. Service message: forum topic created |
|
| 423 | + * @var ForumTopicCreated |
|
| 424 | + */ |
|
| 425 | + public $forum_topic_created; |
|
| 426 | + |
|
| 427 | + /** |
|
| 428 | + * Optional. Service message: forum topic edited |
|
| 429 | + * @var ForumTopicEdited |
|
| 430 | + */ |
|
| 431 | + public $forum_topic_edited; |
|
| 432 | + |
|
| 433 | + /** |
|
| 434 | + * Optional. Service message: forum topic closed |
|
| 435 | + * @var ForumTopicClosed |
|
| 436 | + */ |
|
| 437 | + public $forum_topic_closed; |
|
| 438 | + |
|
| 439 | + /** |
|
| 440 | + * Optional. Service message: forum topic reopened |
|
| 441 | + * @var ForumTopicReopened |
|
| 442 | + */ |
|
| 443 | + public $forum_topic_reopened; |
|
| 444 | 444 | |
| 445 | 445 | /** |
| 446 | 446 | * Optional. Service message: the 'General' forum topic hidden |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace unreal4u\TelegramAPI\Telegram\Methods; |
| 6 | 6 | |