@@ -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; |
@@ -4,6 +4,9 @@ discard block |
||
4 | 4 | |
5 | 5 | trait Send { |
6 | 6 | |
7 | + /** |
|
8 | + * @param string $url |
|
9 | + */ |
|
7 | 10 | abstract protected function exec_curl_request($url, $method); |
8 | 11 | |
9 | 12 | /** |
@@ -200,7 +203,7 @@ discard block |
||
200 | 203 | * - <code>record_audio</code> or <code>upload_audio</code> for audio files |
201 | 204 | * - <code>upload_document</code> for general files |
202 | 205 | * - <code>find_location</code> for location data |
203 | - * @return True on success. |
|
206 | + * @return boolean on success. |
|
204 | 207 | */ |
205 | 208 | public function sendChatAction(string $action) : bool { |
206 | 209 |
@@ -4,6 +4,9 @@ |
||
4 | 4 | |
5 | 5 | trait Updates { |
6 | 6 | |
7 | + /** |
|
8 | + * @param string $url |
|
9 | + */ |
|
7 | 10 | abstract protected function exec_curl_request($url, $method); |
8 | 11 | |
9 | 12 | /** |
@@ -81,7 +81,7 @@ |
||
81 | 81 | |
82 | 82 | // Exec getUpdates |
83 | 83 | $this->exec_curl_request('getUpdates?' . http_build_query($parameters) |
84 | - . '&allowed_updates=' . json_encode($allowed_updates)); |
|
84 | + . '&allowed_updates=' . json_encode($allowed_updates)); |
|
85 | 85 | |
86 | 86 | } |
87 | 87 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * \brief Load a localization file into the localized strings array. |
34 | 34 | * @param $lang Language to load. |
35 | 35 | * @param $dir Directory in which there are the JSON files. |
36 | - * @return True if loaded. False if already loaded. |
|
36 | + * @return boolean if loaded. False if already loaded. |
|
37 | 37 | */ |
38 | 38 | protected function loadSingleLanguage(string $lang = 'en', $dir = './localization') : bool { |
39 | 39 |
@@ -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 |
@@ -4,6 +4,9 @@ |
||
4 | 4 | |
5 | 5 | trait Updates { |
6 | 6 | |
7 | + /** |
|
8 | + * @param string $url |
|
9 | + */ |
|
7 | 10 | abstract protected function exec_curl_request($url, $method); |
8 | 11 | |
9 | 12 | /** |
@@ -4,6 +4,9 @@ |
||
4 | 4 | |
5 | 5 | trait Updates { |
6 | 6 | |
7 | + /** |
|
8 | + * @param string $url |
|
9 | + */ |
|
7 | 10 | abstract protected function exec_curl_request($url, $method); |
8 | 11 | |
9 | 12 | /** |
@@ -4,6 +4,9 @@ |
||
4 | 4 | |
5 | 5 | trait Updates { |
6 | 6 | |
7 | + /** |
|
8 | + * @param string $url |
|
9 | + */ |
|
7 | 10 | abstract protected function exec_curl_request($url, $method); |
8 | 11 | |
9 | 12 | /** |
@@ -433,7 +433,7 @@ |
||
433 | 433 | */ |
434 | 434 | |
435 | 435 | /** \brief Core function to execute HTTP request. |
436 | - * @param $url The request's URL. |
|
436 | + * @param string $url The request's URL. |
|
437 | 437 | * @param $method The request's HTTP method, POST by default. |
438 | 438 | * @return Url response, false on error. |
439 | 439 | */ |