Skip to content

Commit 0567c8c

Browse files
committed
Merge pull request #7 from noplanman/fix_typos
Some typo corrections.
2 parents cb4e9be + bdf46a2 commit 0567c8c

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

src/Commands/AdminCommands/SendtochannelCommand.php

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,11 @@ public function executeNoDB()
254254
}
255255

256256
/**
257-
* Publish
257+
* Publish a message to a channel and return success or failure message
258258
*
259-
* Publish a message in a channel and retun succecs or fail message
260-
* @param Longman\TelegramBot\Entities\Message $message
261-
* @param int $channel
262-
* @param string|null $caption
259+
* @param Entities\Message $message
260+
* @param int $channel
261+
* @param string|null $caption
263262
*
264263
* @return string
265264
*/
@@ -271,12 +270,12 @@ protected function publish(Message $message, $channel, $caption = null)
271270
];
272271

273272
if ($this->sendBack($message, $data)->isOk()) {
274-
$response = 'Message sent succesfully to: ' . $channel;
273+
$response = 'Message sent successfully to: ' . $channel;
275274
} else {
276275
$response =
277276
'Message not sent to: ' . $channel . "\n" .
278-
'- The channel exist?' . "\n" .
279-
'- Is the bot admin of the channel?';
277+
'- Does the channel exist?' . "\n" .
278+
'- Is the bot an admin of the channel?';
280279
}
281280
return $response;
282281
}
@@ -292,10 +291,10 @@ protected function publish(Message $message, $channel, $caption = null)
292291
* @todo This method will be moved at an higher level maybe in AdminCommand or Command
293292
* @todo Looking for a more significative name
294293
*
295-
* @param Longman\TelegramBot\Entities\Message $message
296-
* @param array $data
294+
* @param Entities\Message $message
295+
* @param array $data
297296
*
298-
* @return Longman\TelegramBot\Entities\ServerResponse
297+
* @return Entities\ServerResponse
299298
*/
300299
protected function sendBack(Message $message, array $data)
301300
{
@@ -322,12 +321,12 @@ protected function sendBack(Message $message, array $data)
322321
$data['latitude'] = $message->getLocation()->getLatitude();
323322
$data['longitude'] = $message->getLocation()->getLongitude();
324323
}
325-
$callback_path = 'Longman\TelegramBot' .'\Request';
326-
$callback_function = 'send'.$type;
324+
$callback_path = 'Longman\TelegramBot\Request';
325+
$callback_function = 'send' . $type;
327326
if (! method_exists($callback_path, $callback_function)) {
328-
throw new TelegramException('Methods: '.$callback_function.' not found in class Request.');
327+
throw new TelegramException('Methods: ' . $callback_function . ' not found in class Request.');
329328
}
330329

331-
return call_user_func_array($callback_path.'::'.$callback_function, array($data));
330+
return call_user_func_array($callback_path . '::' . $callback_function, [$data]);
332331
}
333332
}

src/Conversation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public function __construct($user_id, $chat_id, $command = null)
9090
}
9191

9292
/**
93-
* Conversation destructor update the conversation if not stopped
93+
* Conversation destructor updates the conversation
9494
*/
9595
public function __destruct()
9696
{
97-
//Perform the update when the object go out of the stage and notes has changed after load()
97+
//Perform the update when the object goes out of the stage and notes have changed after load()
9898
if ($this->command_is_provided && $this->notes !== $this->protected_notes) {
9999
$this->update();
100100
}

0 commit comments

Comments
 (0)