@@ -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 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Command execute method |
57 | 57 | * |
58 | - * @return \Longman\TelegramBot\Entities\ServerResponse|mixed |
|
58 | + * @return \Longman\TelegramBot\Entities\ServerResponse |
|
59 | 59 | * @throws \Longman\TelegramBot\Exception\TelegramException |
60 | 60 | */ |
61 | 61 | public function execute() |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * |
330 | 330 | * @todo Why send just to the first found channel? |
331 | 331 | * |
332 | - * @return mixed |
|
332 | + * @return \Longman\TelegramBot\Entities\ServerResponse |
|
333 | 333 | * @throws \Longman\TelegramBot\Exception\TelegramException |
334 | 334 | */ |
335 | 335 | public function executeNoDb() |
@@ -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()), |
@@ -251,7 +251,7 @@ |
||
251 | 251 | * @todo Find a better way, as json_* functions are very heavy |
252 | 252 | * |
253 | 253 | * @param array|null $entities |
254 | - * @param mixed $default |
|
254 | + * @param string|null $default |
|
255 | 255 | * |
256 | 256 | * @return mixed |
257 | 257 | */ |
@@ -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 | }); |