@@ -188,7 +188,7 @@ |
||
| 188 | 188 | $this->type = 'Voice'; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - $this->caption = isset($data['caption']) ? $data['caption'] : null;//string |
|
| 191 | + $this->caption = isset($data['caption']) ? $data['caption'] : null; //string |
|
| 192 | 192 | |
| 193 | 193 | $this->contact = isset($data['contact']) ? $data['contact'] : null; |
| 194 | 194 | if (!empty($this->contact)) { |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Longman\TelegramBot\Conversation; |
| 15 | 15 | use Longman\TelegramBot\Commands\UserCommand; |
| 16 | 16 | use Longman\TelegramBot\Entities\ForceReply; |
| 17 | -use Longman\TelegramBot\Entities\ReplyKeyboardHide; |
|
| 18 | 17 | use Longman\TelegramBot\Entities\ReplyKeyboardMarkup; |
| 19 | 18 | |
| 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()), |
@@ -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 | ) |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | throw new TelegramException($e->getMessage()); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return (string)$response->getBody(); |
|
| 75 | + return (string) $response->getBody(); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | //http://openweathermap.org/weather-conditions |
| 93 | - $conditions = [ |
|
| 93 | + $conditions = [ |
|
| 94 | 94 | 'clear' => ' ☀️', |
| 95 | 95 | 'clouds' => ' ☁️', |
| 96 | 96 | 'rain' => ' ☔', |
@@ -262,7 +262,7 @@ |
||
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | //Convert each Entity item into an object based on its JSON reflection |
| 265 | - $json_entities = array_map(function ($entity) { |
|
| 265 | + $json_entities = array_map(function($entity) { |
|
| 266 | 266 | return json_decode($entity, true); |
| 267 | 267 | }, $entities); |
| 268 | 268 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | //Set the object members from the passed data params |
| 64 | 64 | foreach (['resize_keyboard', 'one_time_keyboard', 'selective'] as $param) { |
| 65 | - $this->$param = isset($data[$param]) ? (bool)$data[$param] : false; |
|
| 65 | + $this->$param = isset($data[$param]) ? (bool) $data[$param] : false; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | 'first_name' => 'botname', |
| 156 | 156 | 'username' => 'namebot', |
| 157 | 157 | ]; |
| 158 | - $data['chat'] = ['id' => $data['chat_id']]; |
|
| 158 | + $data['chat'] = ['id' => $data['chat_id']]; |
|
| 159 | 159 | |
| 160 | 160 | $fake_response['result'] = $data; |
| 161 | 161 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | //Fix so that the keyboard markup is a string, not an object |
| 205 | 205 | if (isset($data['reply_markup'])) { |
| 206 | - $data['reply_markup'] = (string)$data['reply_markup']; |
|
| 206 | + $data['reply_markup'] = (string) $data['reply_markup']; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | $request_params = self::setUpRequestParams($data); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | '/bot' . self::$telegram->getApiKey() . '/' . $action, |
| 217 | 217 | $request_params |
| 218 | 218 | ); |
| 219 | - $result = (string)$response->getBody(); |
|
| 219 | + $result = (string) $response->getBody(); |
|
| 220 | 220 | |
| 221 | 221 | //Logging getUpdates Update |
| 222 | 222 | if ($action === 'getUpdates') { |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | //Only get enabled Admin and User commands |
| 57 | 57 | /** @var Command[] $command_objs */ |
| 58 | - $command_objs = array_filter($this->telegram->getCommandsList(), function ($command_obj) { |
|
| 58 | + $command_objs = array_filter($this->telegram->getCommandsList(), function($command_obj) { |
|
| 59 | 59 | /** @var Command $command_obj */ |
| 60 | 60 | return !$command_obj->isSystemCommand() && $command_obj->isEnabled(); |
| 61 | 61 | }); |