@@ -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 |
@@ -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 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param $buttons Buttons passed as inizialization. |
34 | 34 | * @return The object created with the buttons passed. |
35 | 35 | */ |
36 | - public function __construct(\PhpBotFramework\Bot &$bot = null, |
|
36 | + public function __construct(\PhpBotFramework\Bot & $bot = null, |
|
37 | 37 | array $buttons = array()) { |
38 | 38 | |
39 | 39 | // Get bot reference |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | public function getBackButton($json_serialized = true) { |
211 | 211 | |
212 | 212 | // Create the button |
213 | - $inline_keyboard = [ 'inline_keyboard' => |
|
213 | + $inline_keyboard = ['inline_keyboard' => |
|
214 | 214 | [ |
215 | 215 | [ |
216 | 216 | [ |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | public function getBackSkipKeyboard($json_serialized = true) { |
244 | 244 | |
245 | 245 | // Create the keyboard |
246 | - $inline_keyboard = [ 'inline_keyboard' => |
|
246 | + $inline_keyboard = ['inline_keyboard' => |
|
247 | 247 | [ |
248 | 248 | [ |
249 | 249 | [ |
@@ -36,7 +36,7 @@ |
||
36 | 36 | /** |
37 | 37 | * \brief (<i>Internal</i>) Process the message to check if it triggers a command of this type. |
38 | 38 | * @param $message Message to process. |
39 | - * @return True if the message triggered a command. |
|
39 | + * @return boolean if the message triggered a command. |
|
40 | 40 | */ |
41 | 41 | protected function processMessageRegexCommand(array $message) : bool { |
42 | 42 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * \brief (<i>Internal</i>)Get first update offset in redis. |
15 | 15 | * \details Called by getUpdatesRedis to get the offset saved in redis or to get it from telegram and save it in redis. |
16 | 16 | * @param $offset_key Name of the variable where the offset is saved on Redis |
17 | - * @return Id of the first update to process. |
|
17 | + * @return integer of the first update to process. |
|
18 | 18 | */ |
19 | 19 | protected function getUpdateOffsetRedis(string $offset_key) : int { |
20 | 20 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * \details Called by getUpdatesDatabase to get the offset saved in database or to get it from telegram and save it in database. |
103 | 103 | * @param $table_name Name of the table where offset is saved in the database |
104 | 104 | * @param $column_name Name of the column where the offset is saved in the database |
105 | - * @return Id of the first update to process. |
|
105 | + * @return integer of the first update to process. |
|
106 | 106 | */ |
107 | 107 | protected function getUpdateOffsetDatabase(string $table_name, string $column_name) : int { |
108 | 108 |
@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | $this->initCommands(); |
77 | 77 | |
78 | - // Process all updates received |
|
78 | + // Process all updates received |
|
79 | 79 | while (true) { |
80 | 80 | |
81 | 81 | $updates = $this->getUpdates($offset, $limit, $timeout); |
@@ -5,15 +5,15 @@ |
||
5 | 5 | // Use to sort _command_types based on prior |
6 | 6 | function sortingPrior($a, $b) { |
7 | 7 | |
8 | - if($a['prior'] > $b['prior']) |
|
8 | + if ($a['prior'] > $b['prior']) |
|
9 | 9 | |
10 | 10 | return 1; |
11 | 11 | |
12 | - if($a['prior'] < $b['prior']) |
|
12 | + if ($a['prior'] < $b['prior']) |
|
13 | 13 | |
14 | 14 | return -1; |
15 | 15 | |
16 | - if($a['prior'] == $b['prior']) |
|
16 | + if ($a['prior'] == $b['prior']) |
|
17 | 17 | |
18 | 18 | return 0; |
19 | 19 |
@@ -5,17 +5,20 @@ |
||
5 | 5 | // Use to sort _command_types based on prior |
6 | 6 | function sortingPrior($a, $b) { |
7 | 7 | |
8 | - if($a['prior'] > $b['prior']) |
|
9 | - |
|
8 | + if($a['prior'] > $b['prior']) { |
|
9 | + |
|
10 | 10 | return 1; |
11 | + } |
|
11 | 12 | |
12 | - if($a['prior'] < $b['prior']) |
|
13 | - |
|
13 | + if($a['prior'] < $b['prior']) { |
|
14 | + |
|
14 | 15 | return -1; |
16 | + } |
|
15 | 17 | |
16 | - if($a['prior'] == $b['prior']) |
|
17 | - |
|
18 | + if($a['prior'] == $b['prior']) { |
|
19 | + |
|
18 | 20 | return 0; |
21 | + } |
|
19 | 22 | |
20 | 23 | } |
21 | 24 |
@@ -36,7 +36,9 @@ |
||
36 | 36 | $method = Text::camelCase("get $offset"); |
37 | 37 | |
38 | 38 | // If it exists, call it and return its return value |
39 | - if (method_exists($this, $method)) return $this->{$method}(); |
|
39 | + if (method_exists($this, $method)) { |
|
40 | + return $this->{$method}(); |
|
41 | + } |
|
40 | 42 | |
41 | 43 | // If not return the data from the array after checking it is set |
42 | 44 | return isset($this->container[$offset]) ? $this->container[$offset] : null; |
@@ -86,7 +86,7 @@ |
||
86 | 86 | * It also change $language parameter of the bot to the language returned. |
87 | 87 | * @param $default_language <i>Optional</i>. Default language to return in case of errors. |
88 | 88 | * @param $expiring_time <i>Optional</i>. Set the expiring time for the language on redis each time it is took from the sql database. |
89 | - * @return Language for the current user, $default_language on errors. |
|
89 | + * @return string for the current user, $default_language on errors. |
|
90 | 90 | */ |
91 | 91 | public function getLanguageRedis($default_language = 'en', $expiring_time = '86400') : string { |
92 | 92 |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace PhpBotFramework\Test; |
4 | 4 | |
5 | -use PhpBotFramework\Entities\Message; |
|
6 | - |
|
7 | 5 | /* \class FakeUpdate |
8 | 6 | * \brief Contains abstrataction methods for processing fake updates. |
9 | 7 | */ |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | // Exec getUpdates |
84 | 84 | $this->execRequest('getUpdates?' . http_build_query($parameters) |
85 | - . '&allowed_updates=' . json_encode($allowed_updates)); |
|
85 | + . '&allowed_updates=' . json_encode($allowed_updates)); |
|
86 | 86 | |
87 | 87 | } |
88 | 88 |