@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace PhpBotFramework\Core; |
| 4 | 4 | |
| 5 | 5 | use PhpBotFramework\Exceptions\BotException; |
| 6 | - |
|
| 7 | 6 | use PhpBotFramework\Entities\Message; |
| 8 | 7 | use PhpBotFramework\Entities\CallbackQuery; |
| 9 | 8 | use PhpBotFramework\Entities\ChosenInlineResult; |
@@ -232,7 +232,6 @@ |
||
| 232 | 232 | * \brief Called every time a post get edited in the channel where the bot is in. |
| 233 | 233 | * \details Override it to script the bot answer for each post edited in a channel. |
| 234 | 234 | * <code>$chat_id</code> set inside of this function. |
| 235 | - * @param Message $post The message edited in the channel. |
|
| 236 | 235 | */ |
| 237 | 236 | protected function processEditedChannelPost(Message $edited_post) |
| 238 | 237 | { |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | |
| 101 | 101 | // Exec getUpdates |
| 102 | 102 | $this->execRequest('getUpdates?' . http_build_query($parameters) |
| 103 | - . '&allowed_updates=' . json_encode($allowed_updates)); |
|
| 103 | + . '&allowed_updates=' . json_encode($allowed_updates)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** @} */ |
@@ -18,8 +18,6 @@ |
||
| 18 | 18 | |
| 19 | 19 | namespace PhpBotFramework\Test; |
| 20 | 20 | |
| 21 | -use PhpBotFramework\Entities\Message; |
|
| 22 | - |
|
| 23 | 21 | /* \class FakeUpdate |
| 24 | 22 | * \brief Contains abstract methods for processing fake updates. |
| 25 | 23 | */ |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * @param array $buttons Buttons passed as inizialization. |
| 40 | 40 | */ |
| 41 | 41 | public function __construct( |
| 42 | - CoreBot &$bot, |
|
| 42 | + CoreBot & $bot, |
|
| 43 | 43 | array $buttons = array() |
| 44 | 44 | ) { |
| 45 | 45 | // Set bot reference |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function getBackButton($json_serialized = true) |
| 59 | 59 | { |
| 60 | 60 | // Create the button |
| 61 | - $inline_keyboard = [ 'inline_keyboard' => |
|
| 61 | + $inline_keyboard = ['inline_keyboard' => |
|
| 62 | 62 | [ |
| 63 | 63 | [ |
| 64 | 64 | [ |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | public function getBackSkipKeyboard($json_serialized = true) |
| 87 | 87 | { |
| 88 | 88 | // Create the keyboard |
| 89 | - $inline_keyboard = [ 'inline_keyboard' => |
|
| 89 | + $inline_keyboard = ['inline_keyboard' => |
|
| 90 | 90 | [ |
| 91 | 91 | [ |
| 92 | 92 | [ |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | protected function addDefaultValue(array $params) : array |
| 79 | 79 | { |
| 80 | - static $defaults = [ 'adapter' => PDO_DEFAULT_ADAPTER, 'host' => 'localhost' ]; |
|
| 80 | + static $defaults = ['adapter' => PDO_DEFAULT_ADAPTER, 'host' => 'localhost']; |
|
| 81 | 81 | return array_merge($defaults, $params); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -138,8 +138,8 @@ |
||
| 138 | 138 | { |
| 139 | 139 | // If the user has already added a button in this row |
| 140 | 140 | if ($this->column != 0) { |
| 141 | - // Change row |
|
| 142 | - $this->changeRow(); |
|
| 141 | + // Change row |
|
| 142 | + $this->changeRow(); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // Add buttons to the next row |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | $offset = $this->getUpdateOffsetRedis(); |
| 96 | 96 | $this->initCommands(); |
| 97 | 97 | |
| 98 | - // Process all updates received |
|
| 98 | + // Process all updates received |
|
| 99 | 99 | while (true) { |
| 100 | 100 | $updates = $this->getUpdates($offset, $limit, $timeout); |
| 101 | 101 | |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | require_once '../vendor/autoload.php'; |
| 10 | 10 | |
| 11 | 11 | class EchoBot extends PhpBotFramework\Bot { |
| 12 | - // Override processMessage in order to send user the same message it give us. |
|
| 13 | - protected function processMessage($message) { |
|
| 12 | + // Override processMessage in order to send user the same message it give us. |
|
| 13 | + protected function processMessage($message) { |
|
| 14 | 14 | $this->sendMessage($message['text']); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $bot = new EchoBot('YOUR_BOT_TOKEN'); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // Get the language from the bot |
| 63 | 63 | $sth = $this->pdo->prepare('SELECT language FROM ' . $this->user_table . ' WHERE ' |
| 64 | - . $this->id_column . ' = :chat_id'); |
|
| 64 | + . $this->id_column . ' = :chat_id'); |
|
| 65 | 65 | $sth->bindParam(':chat_id', $this->_chat_id); |
| 66 | 66 | |
| 67 | 67 | try { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | // Update the language in the database |
| 99 | 99 | $sth = $this->pdo->prepare('UPDATE ' . $this->user_table . ' SET language = :language WHERE ' |
| 100 | - . $this->id_column . ' = :id'); |
|
| 100 | + . $this->id_column . ' = :id'); |
|
| 101 | 101 | $sth->bindParam(':language', $language); |
| 102 | 102 | $sth->bindParam(':id', $this->_chat_id); |
| 103 | 103 | |