@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | * \details Set $chat_id for each update, $text, $data and $query are set for each update that contains them. |
| 181 | 181 | * It also calls commands for each updates, before process methods. |
| 182 | 182 | * @param $update Reference to the update received. |
| 183 | - * @return The id of the update processed. |
|
| 183 | + * @return integer id of the update processed. |
|
| 184 | 184 | */ |
| 185 | 185 | public function processUpdate(array $update) : int { |
| 186 | 186 | |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | * \brief Get current user language from redis, and set it in language. |
| 715 | 715 | * \details Using redis database we get language stored and the value does not expires. |
| 716 | 716 | * @param $default_language <i>Optional</i>. Default language to return in case of errors. |
| 717 | - * @return Language for the current user, $default_language on errors. |
|
| 717 | + * @return string for the current user, $default_language on errors. |
|
| 718 | 718 | */ |
| 719 | 719 | public function getLanguageRedis($default_language = 'en') : string { |
| 720 | 720 | |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | * It also change $language parameter of the bot to the language returned. |
| 751 | 751 | * @param $default_language <i>Optional</i>. Default language to return in case of errors. |
| 752 | 752 | * @param $expiring_time <i>Optional</i>. Set the expiring time for the language on redis each time it is took from the sql database. |
| 753 | - * @return Language for the current user, $default_language on errors. |
|
| 753 | + * @return string for the current user, $default_language on errors. |
|
| 754 | 754 | */ |
| 755 | 755 | public function getLanguageRedisAsCache($default_language = 'en', $expiring_time = '86400') : string { |
| 756 | 756 | |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | * \brief Get current user status from redis and set it in status variable. |
| 952 | 952 | * \details Throw exception if redis connection is missing. |
| 953 | 953 | * @param $default_status <i>Optional</i>. The default status to return in case there is no status for the current user. |
| 954 | - * @return The status for the current user, $default_status if missing. |
|
| 954 | + * @return integer status for the current user, $default_status if missing. |
|
| 955 | 955 | */ |
| 956 | 956 | public function getStatus($default_status = -1) : int { |
| 957 | 957 | |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | /** \brief Add a user to the database. |
| 999 | 999 | * \details Add a user to the database in Bot::$user_table table and Bot::$id_column column using Bot::$pdo connection. |
| 1000 | 1000 | * @param $chat_id chat_id of the user to add. |
| 1001 | - * @return True on success. |
|
| 1001 | + * @return boolean on success. |
|
| 1002 | 1002 | */ |
| 1003 | 1003 | public function addUser($chat_id) : bool { |
| 1004 | 1004 | |
@@ -1069,7 +1069,7 @@ |
||
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | // Iterate over all the row got |
| 1072 | - while($user = $sth->fetch()) { |
|
| 1072 | + while ($user = $sth->fetch()) { |
|
| 1073 | 1073 | |
| 1074 | 1074 | // Call getChat to know that this users haven't blocked the bot |
| 1075 | 1075 | $user_data = $this->getChat($user[$this->id_column]); |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | * - <code>record_audio</code> or <code>upload_audio</code> for audio files |
| 544 | 544 | * - <code>upload_document</code> for general files |
| 545 | 545 | * - <code>find_location</code> for location data |
| 546 | - * @return True on success. |
|
| 546 | + * @return boolean on success. |
|
| 547 | 547 | */ |
| 548 | 548 | public function sendChatAction(string $action) : bool { |
| 549 | 549 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | */ |
| 727 | 727 | |
| 728 | 728 | /** \brief Core function to execute url request. |
| 729 | - * @param $url The url to call using the curl session. |
|
| 729 | + * @param string $url The url to call using the curl session. |
|
| 730 | 730 | * @return Url response, false on error. |
| 731 | 731 | */ |
| 732 | 732 | protected function exec_curl_request($url) { |
@@ -629,11 +629,11 @@ |
||
| 629 | 629 | public function editInlineMessageText(string $inline_message_id, $text, string $reply_markup = null, string $parse_mode = 'HTML', bool $disable_web_preview = false) { |
| 630 | 630 | |
| 631 | 631 | $parameters = [ |
| 632 | - 'inline_message_id' => $inline_message_id, |
|
| 633 | - 'text' => $text, |
|
| 634 | - 'reply_markup' => $inline_keyboard, |
|
| 635 | - 'parse_mode' => $parse_mode, |
|
| 636 | - 'disable_web_page_preview' => $disable_web_preview, |
|
| 632 | + 'inline_message_id' => $inline_message_id, |
|
| 633 | + 'text' => $text, |
|
| 634 | + 'reply_markup' => $inline_keyboard, |
|
| 635 | + 'parse_mode' => $parse_mode, |
|
| 636 | + 'disable_web_page_preview' => $disable_web_preview, |
|
| 637 | 637 | ]; |
| 638 | 638 | |
| 639 | 639 | return $this->exec_curl_request($this->api_url . 'editMessageText?' . http_build_query($parameters)); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | * @param $reply_markup Inline keyboard object (Not JSON serialized, use getArray from InlineKeyboard class). |
| 41 | 41 | * @param $parse_mode <i>Optional</i>. Formattation of the message. |
| 42 | 42 | * @param $disable_web_preview <i>Optional</i>. Disables link previews for links in the sent message |
| 43 | - * @return Id the the article added |
|
| 43 | + * @return integer the the article added |
|
| 44 | 44 | */ |
| 45 | 45 | public function newArticle($title, $message_text, $description = '', array $reply_markup = null, $parse_mode = 'HTML', $disable_web_preview = false) { |
| 46 | 46 | |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $delimitator_end = '</' . $tag . '>'; |
| 64 | 64 | |
| 65 | 65 | // For each username |
| 66 | - for($i = 0; $i !== $count; $i++) { |
|
| 66 | + for ($i = 0; $i !== $count; $i++) { |
|
| 67 | 67 | |
| 68 | 68 | // Put the Delimitator_end before the username and the start one after it |
| 69 | 69 | $string = str_replace($usernames[$i], $delimitator_end . $usernames[$i] . $delimitator_start, $string); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | * \details Remove the $modificator html formattation from a message containing telegram username, to let the user click them. |
| 46 | 46 | * @param $string to parse. |
| 47 | 47 | * @param $tag Formattation tag to remove. |
| 48 | - * @return The string, modified if there are usernames. Otherwise $string. |
|
| 48 | + * @return string string, modified if there are usernames. Otherwise $string. |
|
| 49 | 49 | */ |
| 50 | 50 | static public function removeUsernameFormattation(string $string, string $tag) : string { |
| 51 | 51 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param $buttons Buttons passed as inizialization. |
| 28 | 28 | * @return The object created with the buttons passed. |
| 29 | 29 | */ |
| 30 | - public function __construct(CoreBot &$bot = null, array $buttons = array()) { |
|
| 30 | + public function __construct(CoreBot & $bot = null, array $buttons = array()) { |
|
| 31 | 31 | |
| 32 | 32 | $this->bot = $bot; |
| 33 | 33 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function getBackButton($json_serialized = true) { |
| 136 | 136 | |
| 137 | 137 | // Create the button |
| 138 | - $inline_keyboard = [ 'inline_keyboard' => |
|
| 138 | + $inline_keyboard = ['inline_keyboard' => |
|
| 139 | 139 | [ |
| 140 | 140 | [ |
| 141 | 141 | [ |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | public function getBackSkipKeyboard($json_serialized = true) { |
| 169 | 169 | |
| 170 | 170 | // Create the keyboard |
| 171 | - $inline_keyboard = [ 'inline_keyboard' => |
|
| 171 | + $inline_keyboard = ['inline_keyboard' => |
|
| 172 | 172 | [ |
| 173 | 173 | [ |
| 174 | 174 | [ |
@@ -129,8 +129,8 @@ |
||
| 129 | 129 | // If the user has already added a button in this row |
| 130 | 130 | if ($this->column != 0) { |
| 131 | 131 | |
| 132 | - // Change row |
|
| 133 | - $this->changeRow(); |
|
| 132 | + // Change row |
|
| 133 | + $this->changeRow(); |
|
| 134 | 134 | |
| 135 | 135 | } |
| 136 | 136 | |