@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | try { |
| 42 | 42 | $client = new \GuzzleHttp\Client(); |
| 43 | 43 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 44 | - $response = json_decode( $json_response->getBody() ); |
|
| 44 | + $response = json_decode($json_response->getBody()); |
|
| 45 | 45 | } |
| 46 | 46 | catch (RequestException $e) { |
| 47 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 47 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if($response->{'ok'} === FALSE) { |
|
| 51 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 50 | + if ($response->{'ok'} === FALSE) { |
|
| 51 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $this; |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | try { |
| 91 | 91 | $client = new \GuzzleHttp\Client(); |
| 92 | 92 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 93 | - $response = json_decode( $json_response->getBody() ); |
|
| 93 | + $response = json_decode($json_response->getBody()); |
|
| 94 | 94 | } |
| 95 | 95 | catch (RequestException $e) { |
| 96 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 96 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if($response->{'ok'} === FALSE) { |
|
| 100 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 99 | + if ($response->{'ok'} === FALSE) { |
|
| 100 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | return $json_response->getBody(); |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | // Set the arguments of the request |
| 146 | 146 | $arguments = array( |
| 147 | - "ts_from" => (string)$ts_from, |
|
| 148 | - "ts_to" => (string)$ts_to, |
|
| 147 | + "ts_from" => (string) $ts_from, |
|
| 148 | + "ts_to" => (string) $ts_to, |
|
| 149 | 149 | "types" => $types, |
| 150 | 150 | "count" => $count, |
| 151 | 151 | "page" => $page |
@@ -164,14 +164,14 @@ discard block |
||
| 164 | 164 | try { |
| 165 | 165 | $client = new \GuzzleHttp\Client(); |
| 166 | 166 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 167 | - $response = json_decode( $json_response->getBody() ); |
|
| 167 | + $response = json_decode($json_response->getBody()); |
|
| 168 | 168 | } |
| 169 | 169 | catch (RequestException $e) { |
| 170 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 170 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - if($response->{'ok'} === FALSE) { |
|
| 174 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 173 | + if ($response->{'ok'} === FALSE) { |
|
| 174 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $json_response->getBody(); |
@@ -203,14 +203,14 @@ discard block |
||
| 203 | 203 | try { |
| 204 | 204 | $client = new \GuzzleHttp\Client(); |
| 205 | 205 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 206 | - $response = json_decode( $json_response->getBody() ); |
|
| 206 | + $response = json_decode($json_response->getBody()); |
|
| 207 | 207 | } |
| 208 | 208 | catch (RequestException $e) { |
| 209 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 209 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - if($response->{'ok'} === FALSE) { |
|
| 213 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 212 | + if ($response->{'ok'} === FALSE) { |
|
| 213 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | return $this; |
@@ -242,14 +242,14 @@ discard block |
||
| 242 | 242 | try { |
| 243 | 243 | $client = new \GuzzleHttp\Client(); |
| 244 | 244 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 245 | - $response = json_decode( $json_response->getBody() ); |
|
| 245 | + $response = json_decode($json_response->getBody()); |
|
| 246 | 246 | } |
| 247 | 247 | catch (RequestException $e) { |
| 248 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 248 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - if($response->{'ok'} === FALSE) { |
|
| 252 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 251 | + if ($response->{'ok'} === FALSE) { |
|
| 252 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | return $json_response->getBody(); |
@@ -292,8 +292,8 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | // Get the content of the file |
| 295 | - if(file_exists( $path_to_file )) { |
|
| 296 | - $content = file_get_contents( $path_to_file ); |
|
| 295 | + if (file_exists($path_to_file)) { |
|
| 296 | + $content = file_get_contents($path_to_file); |
|
| 297 | 297 | } |
| 298 | 298 | else { |
| 299 | 299 | throw new RuntimeException("The path to the file is not valid."); |
@@ -322,14 +322,14 @@ discard block |
||
| 322 | 322 | 'http_errors' => false, |
| 323 | 323 | 'json' => $post_content |
| 324 | 324 | ]); |
| 325 | - $response = json_decode( $json_response->getBody() ); |
|
| 325 | + $response = json_decode($json_response->getBody()); |
|
| 326 | 326 | } |
| 327 | 327 | catch (RequestException $e) { |
| 328 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 328 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - if($response->{'ok'} === FALSE) { |
|
| 332 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 331 | + if ($response->{'ok'} === FALSE) { |
|
| 332 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | return $this; |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | // Set the arguments of the request |
| 42 | 42 | $arguments = array( |
| 43 | - "ts" => (string)$ts, |
|
| 43 | + "ts" => (string) $ts, |
|
| 44 | 44 | "channel" => $channel |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | - if($as_user != NULL) { |
|
| 47 | + if ($as_user != NULL) { |
|
| 48 | 48 | $arguments["as_user"] = $as_user; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | try { |
| 55 | 55 | $client = new \GuzzleHttp\Client(); |
| 56 | 56 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 57 | - $response = json_decode( $json_response->getBody() ); |
|
| 57 | + $response = json_decode($json_response->getBody()); |
|
| 58 | 58 | } |
| 59 | 59 | catch (RequestException $e) { |
| 60 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 60 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if($response->{'ok'} === FALSE) { |
|
| 64 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 63 | + if ($response->{'ok'} === FALSE) { |
|
| 64 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | return $json_response->getBody(); |
@@ -98,14 +98,14 @@ discard block |
||
| 98 | 98 | try { |
| 99 | 99 | $client = new \GuzzleHttp\Client(); |
| 100 | 100 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 101 | - $response = json_decode( $json_response->getBody() ); |
|
| 101 | + $response = json_decode($json_response->getBody()); |
|
| 102 | 102 | } |
| 103 | 103 | catch (RequestException $e) { |
| 104 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 104 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if($response->{'ok'} === FALSE) { |
|
| 108 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 107 | + if ($response->{'ok'} === FALSE) { |
|
| 108 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $json_response->getBody(); |
@@ -188,20 +188,20 @@ discard block |
||
| 188 | 188 | "reply_broadcast" => $reply_broadcast |
| 189 | 189 | ); |
| 190 | 190 | |
| 191 | - if($attachments != NULL) { |
|
| 191 | + if ($attachments != NULL) { |
|
| 192 | 192 | $arguments["attachments"] = $attachments; |
| 193 | 193 | } |
| 194 | - if($username != NULL) { |
|
| 194 | + if ($username != NULL) { |
|
| 195 | 195 | $arguments["username"] = $username; |
| 196 | 196 | } |
| 197 | - if($icon_url != NULL) { |
|
| 197 | + if ($icon_url != NULL) { |
|
| 198 | 198 | $arguments["icon_url"] = $icon_url; |
| 199 | 199 | } |
| 200 | - if($icon_emoji != NULL) { |
|
| 200 | + if ($icon_emoji != NULL) { |
|
| 201 | 201 | $arguments["icon_emoji"] = $icon_emoji; |
| 202 | 202 | } |
| 203 | - if($thread_ts != NULL) { |
|
| 204 | - $arguments["thread_ts"] = (string)$thread_ts; |
|
| 203 | + if ($thread_ts != NULL) { |
|
| 204 | + $arguments["thread_ts"] = (string) $thread_ts; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | $this->setUrl("chat.postMessage", $arguments); |
@@ -210,14 +210,14 @@ discard block |
||
| 210 | 210 | try { |
| 211 | 211 | $client = new \GuzzleHttp\Client(); |
| 212 | 212 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 213 | - $response = json_decode( $json_response->getBody() ); |
|
| 213 | + $response = json_decode($json_response->getBody()); |
|
| 214 | 214 | } |
| 215 | 215 | catch (RequestException $e) { |
| 216 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 216 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - if($response->{'ok'} === FALSE) { |
|
| 220 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 219 | + if ($response->{'ok'} === FALSE) { |
|
| 220 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | return $json_response->getBody(); |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | // Set the arguments of the request |
| 266 | 266 | $arguments = array( |
| 267 | - "ts" => (string)$ts, |
|
| 267 | + "ts" => (string) $ts, |
|
| 268 | 268 | "channel" => $channel, |
| 269 | 269 | "text" => $text, |
| 270 | 270 | "parse" => $parse, |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | "as_user" => $as_user, |
| 273 | 273 | ); |
| 274 | 274 | |
| 275 | - if($attachments != NULL) { |
|
| 275 | + if ($attachments != NULL) { |
|
| 276 | 276 | $arguments["attachments"] = $attachments; |
| 277 | 277 | } |
| 278 | 278 | |
@@ -282,14 +282,14 @@ discard block |
||
| 282 | 282 | try { |
| 283 | 283 | $client = new \GuzzleHttp\Client(); |
| 284 | 284 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 285 | - $response = json_decode( $json_response->getBody() ); |
|
| 285 | + $response = json_decode($json_response->getBody()); |
|
| 286 | 286 | } |
| 287 | 287 | catch (RequestException $e) { |
| 288 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 288 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - if($response->{'ok'} === FALSE) { |
|
| 292 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 291 | + if ($response->{'ok'} === FALSE) { |
|
| 292 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | return $json_response->getBody(); |
@@ -76,15 +76,15 @@ |
||
| 76 | 76 | foreach ($arguments as $key => $value) { |
| 77 | 77 | $arguments_list[] = $key . "=" . $value; |
| 78 | 78 | |
| 79 | - if(strcmp($key, "token") == 0) { |
|
| 79 | + if (strcmp($key, "token") == 0) { |
|
| 80 | 80 | $token_is_set = TRUE; |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // If the token has not been set, add it to the list |
| 86 | - if(!$token_is_set && isset($this->token) && is_string($this->token)) { |
|
| 87 | - $arguments_list[] = "token=".$this->token; |
|
| 86 | + if (!$token_is_set && isset($this->token) && is_string($this->token)) { |
|
| 87 | + $arguments_list[] = "token=" . $this->token; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $this->url = self::SLACK_API_URL . $method . "?" . implode("&", $arguments_list); |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | try { |
| 42 | 42 | $client = new \GuzzleHttp\Client(); |
| 43 | 43 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 44 | - $response = json_decode( $json_response->getBody() ); |
|
| 44 | + $response = json_decode($json_response->getBody()); |
|
| 45 | 45 | } |
| 46 | 46 | catch (RequestException $e) { |
| 47 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 47 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if($response->{'ok'} === FALSE) { |
|
| 51 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 50 | + if ($response->{'ok'} === FALSE) { |
|
| 51 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $this; |
@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | try { |
| 81 | 81 | $client = new \GuzzleHttp\Client(); |
| 82 | 82 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 83 | - $response = json_decode( $json_response->getBody() ); |
|
| 83 | + $response = json_decode($json_response->getBody()); |
|
| 84 | 84 | } |
| 85 | 85 | catch (RequestException $e) { |
| 86 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 86 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if($response->{'ok'} === FALSE) { |
|
| 90 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 89 | + if ($response->{'ok'} === FALSE) { |
|
| 90 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return $json_response->getBody(); |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | try { |
| 142 | 142 | $client = new \GuzzleHttp\Client(); |
| 143 | 143 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 144 | - $response = json_decode( $json_response->getBody() ); |
|
| 144 | + $response = json_decode($json_response->getBody()); |
|
| 145 | 145 | } |
| 146 | 146 | catch (RequestException $e) { |
| 147 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 147 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if($response->{'ok'} === FALSE) { |
|
| 151 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 150 | + if ($response->{'ok'} === FALSE) { |
|
| 151 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $json_response->getBody(); |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | try { |
| 181 | 181 | $client = new \GuzzleHttp\Client(); |
| 182 | 182 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 183 | - $response = json_decode( $json_response->getBody() ); |
|
| 183 | + $response = json_decode($json_response->getBody()); |
|
| 184 | 184 | } |
| 185 | 185 | catch (RequestException $e) { |
| 186 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 186 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if($response->{'ok'} === FALSE) { |
|
| 190 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 189 | + if ($response->{'ok'} === FALSE) { |
|
| 190 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $json_response->getBody(); |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | try { |
| 225 | 225 | $client = new \GuzzleHttp\Client(); |
| 226 | 226 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 227 | - $response = json_decode( $json_response->getBody() ); |
|
| 227 | + $response = json_decode($json_response->getBody()); |
|
| 228 | 228 | } |
| 229 | 229 | catch (RequestException $e) { |
| 230 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 230 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - if($response->{'ok'} === FALSE) { |
|
| 234 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 233 | + if ($response->{'ok'} === FALSE) { |
|
| 234 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | return $json_response->getBody(); |
@@ -263,14 +263,14 @@ discard block |
||
| 263 | 263 | try { |
| 264 | 264 | $client = new \GuzzleHttp\Client(); |
| 265 | 265 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 266 | - $response = json_decode( $json_response->getBody() ); |
|
| 266 | + $response = json_decode($json_response->getBody()); |
|
| 267 | 267 | } |
| 268 | 268 | catch (RequestException $e) { |
| 269 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 269 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - if($response->{'ok'} === FALSE) { |
|
| 273 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 272 | + if ($response->{'ok'} === FALSE) { |
|
| 273 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | return $json_response->getBody(); |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | try { |
| 308 | 308 | $client = new \GuzzleHttp\Client(); |
| 309 | 309 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 310 | - $response = json_decode( $json_response->getBody() ); |
|
| 310 | + $response = json_decode($json_response->getBody()); |
|
| 311 | 311 | } |
| 312 | 312 | catch (RequestException $e) { |
| 313 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 313 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - if($response->{'ok'} === FALSE) { |
|
| 317 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 316 | + if ($response->{'ok'} === FALSE) { |
|
| 317 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | return $this; |
@@ -346,14 +346,14 @@ discard block |
||
| 346 | 346 | try { |
| 347 | 347 | $client = new \GuzzleHttp\Client(); |
| 348 | 348 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 349 | - $response = json_decode( $json_response->getBody() ); |
|
| 349 | + $response = json_decode($json_response->getBody()); |
|
| 350 | 350 | } |
| 351 | 351 | catch (RequestException $e) { |
| 352 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 352 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | - if($response->{'ok'} === FALSE) { |
|
| 356 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 355 | + if ($response->{'ok'} === FALSE) { |
|
| 356 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | return $this; |
@@ -385,14 +385,14 @@ discard block |
||
| 385 | 385 | try { |
| 386 | 386 | $client = new \GuzzleHttp\Client(); |
| 387 | 387 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 388 | - $response = json_decode( $json_response->getBody() ); |
|
| 388 | + $response = json_decode($json_response->getBody()); |
|
| 389 | 389 | } |
| 390 | 390 | catch (RequestException $e) { |
| 391 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 391 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - if($response->{'ok'} === FALSE) { |
|
| 395 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 394 | + if ($response->{'ok'} === FALSE) { |
|
| 395 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | return $json_response->getBody(); |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | // Set the arguments of the request |
| 421 | 421 | $arguments = array( |
| 422 | 422 | "channel" => $channel, |
| 423 | - "ts" => (string)$ts |
|
| 423 | + "ts" => (string) $ts |
|
| 424 | 424 | ); |
| 425 | 425 | |
| 426 | 426 | $this->setUrl("channels.mark", $arguments); |
@@ -429,14 +429,14 @@ discard block |
||
| 429 | 429 | try { |
| 430 | 430 | $client = new \GuzzleHttp\Client(); |
| 431 | 431 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 432 | - $response = json_decode( $json_response->getBody() ); |
|
| 432 | + $response = json_decode($json_response->getBody()); |
|
| 433 | 433 | } |
| 434 | 434 | catch (RequestException $e) { |
| 435 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 435 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | - if($response->{'ok'} === FALSE) { |
|
| 439 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 438 | + if ($response->{'ok'} === FALSE) { |
|
| 439 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | return $this; |
@@ -478,14 +478,14 @@ discard block |
||
| 478 | 478 | try { |
| 479 | 479 | $client = new \GuzzleHttp\Client(); |
| 480 | 480 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 481 | - $response = json_decode( $json_response->getBody() ); |
|
| 481 | + $response = json_decode($json_response->getBody()); |
|
| 482 | 482 | } |
| 483 | 483 | catch (RequestException $e) { |
| 484 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 484 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | - if($response->{'ok'} === FALSE) { |
|
| 488 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 487 | + if ($response->{'ok'} === FALSE) { |
|
| 488 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | return $json_response->getBody(); |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | // Set the arguments of the request |
| 514 | 514 | $arguments = array( |
| 515 | 515 | "channel" => $channel, |
| 516 | - "thread_ts" => (string)$thread_ts |
|
| 516 | + "thread_ts" => (string) $thread_ts |
|
| 517 | 517 | ); |
| 518 | 518 | |
| 519 | 519 | $this->setUrl("channels.replies", $arguments); |
@@ -522,14 +522,14 @@ discard block |
||
| 522 | 522 | try { |
| 523 | 523 | $client = new \GuzzleHttp\Client(); |
| 524 | 524 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 525 | - $response = json_decode( $json_response->getBody() ); |
|
| 525 | + $response = json_decode($json_response->getBody()); |
|
| 526 | 526 | } |
| 527 | 527 | catch (RequestException $e) { |
| 528 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 528 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - if($response->{'ok'} === FALSE) { |
|
| 532 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 531 | + if ($response->{'ok'} === FALSE) { |
|
| 532 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | return $json_response->getBody(); |
@@ -566,14 +566,14 @@ discard block |
||
| 566 | 566 | try { |
| 567 | 567 | $client = new \GuzzleHttp\Client(); |
| 568 | 568 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 569 | - $response = json_decode( $json_response->getBody() ); |
|
| 569 | + $response = json_decode($json_response->getBody()); |
|
| 570 | 570 | } |
| 571 | 571 | catch (RequestException $e) { |
| 572 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 572 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - if($response->{'ok'} === FALSE) { |
|
| 576 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 575 | + if ($response->{'ok'} === FALSE) { |
|
| 576 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | return $this; |
@@ -610,14 +610,14 @@ discard block |
||
| 610 | 610 | try { |
| 611 | 611 | $client = new \GuzzleHttp\Client(); |
| 612 | 612 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 613 | - $response = json_decode( $json_response->getBody() ); |
|
| 613 | + $response = json_decode($json_response->getBody()); |
|
| 614 | 614 | } |
| 615 | 615 | catch (RequestException $e) { |
| 616 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 616 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 617 | 617 | } |
| 618 | 618 | |
| 619 | - if($response->{'ok'} === FALSE) { |
|
| 620 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 619 | + if ($response->{'ok'} === FALSE) { |
|
| 620 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | return $this; |
@@ -649,14 +649,14 @@ discard block |
||
| 649 | 649 | try { |
| 650 | 650 | $client = new \GuzzleHttp\Client(); |
| 651 | 651 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 652 | - $response = json_decode( $json_response->getBody() ); |
|
| 652 | + $response = json_decode($json_response->getBody()); |
|
| 653 | 653 | } |
| 654 | 654 | catch (RequestException $e) { |
| 655 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 655 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 656 | 656 | } |
| 657 | 657 | |
| 658 | - if($response->{'ok'} === FALSE) { |
|
| 659 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 658 | + if ($response->{'ok'} === FALSE) { |
|
| 659 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | return $this; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | "code" => $code |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - if($redirect_uri != NULL) { |
|
| 52 | + if ($redirect_uri != NULL) { |
|
| 53 | 53 | $arguments["redirect_uri"] = $redirect_uri; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -59,14 +59,14 @@ discard block |
||
| 59 | 59 | try { |
| 60 | 60 | $client = new \GuzzleHttp\Client(); |
| 61 | 61 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 62 | - $response = json_decode( $json_response->getBody() ); |
|
| 62 | + $response = json_decode($json_response->getBody()); |
|
| 63 | 63 | } |
| 64 | 64 | catch (RequestException $e) { |
| 65 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 65 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - if($response->{'ok'} === FALSE) { |
|
| 69 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 68 | + if ($response->{'ok'} === FALSE) { |
|
| 69 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | return $json_response->getBody(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | // Set the arguments of the request |
| 42 | 42 | $arguments = array( |
| 43 | 43 | "text" => $text, |
| 44 | - "time" => (string)$time |
|
| 44 | + "time" => (string) $time |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | if ($user != NULL) { |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | try { |
| 55 | 55 | $client = new \GuzzleHttp\Client(); |
| 56 | 56 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 57 | - $response = json_decode( $json_response->getBody() ); |
|
| 57 | + $response = json_decode($json_response->getBody()); |
|
| 58 | 58 | } |
| 59 | 59 | catch (RequestException $e) { |
| 60 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 60 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if($response->{'ok'} === FALSE) { |
|
| 64 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 63 | + if ($response->{'ok'} === FALSE) { |
|
| 64 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | return $json_response->getBody(); |
@@ -94,14 +94,14 @@ discard block |
||
| 94 | 94 | try { |
| 95 | 95 | $client = new \GuzzleHttp\Client(); |
| 96 | 96 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 97 | - $response = json_decode( $json_response->getBody() ); |
|
| 97 | + $response = json_decode($json_response->getBody()); |
|
| 98 | 98 | } |
| 99 | 99 | catch (RequestException $e) { |
| 100 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 100 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - if($response->{'ok'} === FALSE) { |
|
| 104 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 103 | + if ($response->{'ok'} === FALSE) { |
|
| 104 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return $this; |
@@ -134,14 +134,14 @@ discard block |
||
| 134 | 134 | try { |
| 135 | 135 | $client = new \GuzzleHttp\Client(); |
| 136 | 136 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 137 | - $response = json_decode( $json_response->getBody() ); |
|
| 137 | + $response = json_decode($json_response->getBody()); |
|
| 138 | 138 | } |
| 139 | 139 | catch (RequestException $e) { |
| 140 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 140 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - if($response->{'ok'} === FALSE) { |
|
| 144 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 143 | + if ($response->{'ok'} === FALSE) { |
|
| 144 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return $this; |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | try { |
| 175 | 175 | $client = new \GuzzleHttp\Client(); |
| 176 | 176 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 177 | - $response = json_decode( $json_response->getBody() ); |
|
| 177 | + $response = json_decode($json_response->getBody()); |
|
| 178 | 178 | } |
| 179 | 179 | catch (RequestException $e) { |
| 180 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 180 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - if($response->{'ok'} === FALSE) { |
|
| 184 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 183 | + if ($response->{'ok'} === FALSE) { |
|
| 184 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | return $json_response->getBody(); |
@@ -203,14 +203,14 @@ discard block |
||
| 203 | 203 | try { |
| 204 | 204 | $client = new \GuzzleHttp\Client(); |
| 205 | 205 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 206 | - $response = json_decode( $json_response->getBody() ); |
|
| 206 | + $response = json_decode($json_response->getBody()); |
|
| 207 | 207 | } |
| 208 | 208 | catch (RequestException $e) { |
| 209 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 209 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - if($response->{'ok'} === FALSE) { |
|
| 213 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 212 | + if ($response->{'ok'} === FALSE) { |
|
| 213 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | return $json_response->getBody(); |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | try { |
| 31 | 31 | $client = new \GuzzleHttp\Client(); |
| 32 | 32 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 33 | - $response = json_decode( $json_response->getBody() ); |
|
| 33 | + $response = json_decode($json_response->getBody()); |
|
| 34 | 34 | } |
| 35 | 35 | catch (RequestException $e) { |
| 36 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 36 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if($response->{'ok'} === FALSE) { |
|
| 40 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 39 | + if ($response->{'ok'} === FALSE) { |
|
| 40 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return $this; |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | try { |
| 71 | 71 | $client = new \GuzzleHttp\Client(); |
| 72 | 72 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 73 | - $response = json_decode( $json_response->getBody() ); |
|
| 73 | + $response = json_decode($json_response->getBody()); |
|
| 74 | 74 | } |
| 75 | 75 | catch (RequestException $e) { |
| 76 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 76 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if($response->{'ok'} === FALSE) { |
|
| 80 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 79 | + if ($response->{'ok'} === FALSE) { |
|
| 80 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | return $json_response->getBody(); |
@@ -99,14 +99,14 @@ discard block |
||
| 99 | 99 | try { |
| 100 | 100 | $client = new \GuzzleHttp\Client(); |
| 101 | 101 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 102 | - $response = json_decode( $json_response->getBody() ); |
|
| 102 | + $response = json_decode($json_response->getBody()); |
|
| 103 | 103 | } |
| 104 | 104 | catch (RequestException $e) { |
| 105 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 105 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if($response->{'ok'} === FALSE) { |
|
| 109 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 108 | + if ($response->{'ok'} === FALSE) { |
|
| 109 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return $json_response->getBody(); |
@@ -140,14 +140,14 @@ discard block |
||
| 140 | 140 | try { |
| 141 | 141 | $client = new \GuzzleHttp\Client(); |
| 142 | 142 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 143 | - $response = json_decode( $json_response->getBody() ); |
|
| 143 | + $response = json_decode($json_response->getBody()); |
|
| 144 | 144 | } |
| 145 | 145 | catch (RequestException $e) { |
| 146 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 146 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - if($response->{'ok'} === FALSE) { |
|
| 150 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 149 | + if ($response->{'ok'} === FALSE) { |
|
| 150 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return $json_response->getBody(); |
@@ -182,14 +182,14 @@ discard block |
||
| 182 | 182 | try { |
| 183 | 183 | $client = new \GuzzleHttp\Client(); |
| 184 | 184 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 185 | - $response = json_decode( $json_response->getBody() ); |
|
| 185 | + $response = json_decode($json_response->getBody()); |
|
| 186 | 186 | } |
| 187 | 187 | catch (RequestException $e) { |
| 188 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 188 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - if($response->{'ok'} === FALSE) { |
|
| 192 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 191 | + if ($response->{'ok'} === FALSE) { |
|
| 192 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | return $json_response->getBody(); |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | try { |
| 212 | 212 | $client = new \GuzzleHttp\Client(); |
| 213 | 213 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 214 | - $response = json_decode( $json_response->getBody() ); |
|
| 214 | + $response = json_decode($json_response->getBody()); |
|
| 215 | 215 | } |
| 216 | 216 | catch (RequestException $e) { |
| 217 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 217 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - if($response->{'ok'} === FALSE) { |
|
| 221 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 220 | + if ($response->{'ok'} === FALSE) { |
|
| 221 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | return $this; |
@@ -280,14 +280,14 @@ discard block |
||
| 280 | 280 | 'http_errors' => false, |
| 281 | 281 | 'multipart' => $arguments |
| 282 | 282 | ]); |
| 283 | - $response = json_decode( $json_response->getBody() ); |
|
| 283 | + $response = json_decode($json_response->getBody()); |
|
| 284 | 284 | } |
| 285 | 285 | catch (RequestException $e) { |
| 286 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 286 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - if($response->{'ok'} === FALSE) { |
|
| 290 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 289 | + if ($response->{'ok'} === FALSE) { |
|
| 290 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | return $this; |
@@ -320,14 +320,14 @@ discard block |
||
| 320 | 320 | try { |
| 321 | 321 | $client = new \GuzzleHttp\Client(); |
| 322 | 322 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 323 | - $response = json_decode( $json_response->getBody() ); |
|
| 323 | + $response = json_decode($json_response->getBody()); |
|
| 324 | 324 | } |
| 325 | 325 | catch (RequestException $e) { |
| 326 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 326 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - if($response->{'ok'} === FALSE) { |
|
| 330 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 329 | + if ($response->{'ok'} === FALSE) { |
|
| 330 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | return $this; |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | try { |
| 42 | 42 | $client = new \GuzzleHttp\Client(); |
| 43 | 43 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 44 | - $response = json_decode( $json_response->getBody() ); |
|
| 44 | + $response = json_decode($json_response->getBody()); |
|
| 45 | 45 | } |
| 46 | 46 | catch (RequestException $e) { |
| 47 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 47 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if($response->{'ok'} === FALSE) { |
|
| 51 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 50 | + if ($response->{'ok'} === FALSE) { |
|
| 51 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $this; |
@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | "channel" => $channel, |
| 96 | 96 | "latest" => $latest, |
| 97 | 97 | "oldest" => $oldest, |
| 98 | - "inclusive" => (string)$inclusive, |
|
| 99 | - "count" => (string)$count, |
|
| 100 | - "unreads" => (string)$unreads |
|
| 98 | + "inclusive" => (string) $inclusive, |
|
| 99 | + "count" => (string) $count, |
|
| 100 | + "unreads" => (string) $unreads |
|
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | $this->setUrl("mpim.history", $arguments); |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | try { |
| 107 | 107 | $client = new \GuzzleHttp\Client(); |
| 108 | 108 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 109 | - $response = json_decode( $json_response->getBody() ); |
|
| 109 | + $response = json_decode($json_response->getBody()); |
|
| 110 | 110 | } |
| 111 | 111 | catch (RequestException $e) { |
| 112 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 112 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if($response->{'ok'} === FALSE) { |
|
| 116 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 115 | + if ($response->{'ok'} === FALSE) { |
|
| 116 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | return $json_response->getBody(); |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | try { |
| 136 | 136 | $client = new \GuzzleHttp\Client(); |
| 137 | 137 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 138 | - $response = json_decode( $json_response->getBody() ); |
|
| 138 | + $response = json_decode($json_response->getBody()); |
|
| 139 | 139 | } |
| 140 | 140 | catch (RequestException $e) { |
| 141 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 141 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if($response->{'ok'} === FALSE) { |
|
| 145 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 144 | + if ($response->{'ok'} === FALSE) { |
|
| 145 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | return $json_response->getBody(); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | // Set the arguments of the request |
| 172 | 172 | $arguments = array( |
| 173 | 173 | "channel" => $channel, |
| 174 | - "ts" => (string)$ts |
|
| 174 | + "ts" => (string) $ts |
|
| 175 | 175 | ); |
| 176 | 176 | |
| 177 | 177 | $this->setUrl("mpim.mark", $arguments); |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | try { |
| 181 | 181 | $client = new \GuzzleHttp\Client(); |
| 182 | 182 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 183 | - $response = json_decode( $json_response->getBody() ); |
|
| 183 | + $response = json_decode($json_response->getBody()); |
|
| 184 | 184 | } |
| 185 | 185 | catch (RequestException $e) { |
| 186 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 186 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if($response->{'ok'} === FALSE) { |
|
| 190 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 189 | + if ($response->{'ok'} === FALSE) { |
|
| 190 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $this; |
@@ -218,10 +218,10 @@ discard block |
||
| 218 | 218 | "users" => $users |
| 219 | 219 | ); |
| 220 | 220 | |
| 221 | - if(($return_im != NULL) && ($return_im === TRUE)) { |
|
| 221 | + if (($return_im != NULL) && ($return_im === TRUE)) { |
|
| 222 | 222 | $arguments["return_im"] = 1; |
| 223 | 223 | } |
| 224 | - elseif(($return_im != NULL) && ($return_im === FALSE)) { |
|
| 224 | + elseif (($return_im != NULL) && ($return_im === FALSE)) { |
|
| 225 | 225 | $arguments["return_im"] = 0; |
| 226 | 226 | } |
| 227 | 227 | |
@@ -231,14 +231,14 @@ discard block |
||
| 231 | 231 | try { |
| 232 | 232 | $client = new \GuzzleHttp\Client(); |
| 233 | 233 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 234 | - $response = json_decode( $json_response->getBody() ); |
|
| 234 | + $response = json_decode($json_response->getBody()); |
|
| 235 | 235 | } |
| 236 | 236 | catch (RequestException $e) { |
| 237 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 237 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - if($response->{'ok'} === FALSE) { |
|
| 241 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 240 | + if ($response->{'ok'} === FALSE) { |
|
| 241 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | return $json_response->getBody(); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | // Set the arguments of the request |
| 268 | 268 | $arguments = array( |
| 269 | 269 | "channel" => $channel, |
| 270 | - "thread_ts" => (string)$thread_ts |
|
| 270 | + "thread_ts" => (string) $thread_ts |
|
| 271 | 271 | ); |
| 272 | 272 | |
| 273 | 273 | $this->setUrl("mpim.replies", $arguments); |
@@ -276,14 +276,14 @@ discard block |
||
| 276 | 276 | try { |
| 277 | 277 | $client = new \GuzzleHttp\Client(); |
| 278 | 278 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 279 | - $response = json_decode( $json_response->getBody() ); |
|
| 279 | + $response = json_decode($json_response->getBody()); |
|
| 280 | 280 | } |
| 281 | 281 | catch (RequestException $e) { |
| 282 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 282 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - if($response->{'ok'} === FALSE) { |
|
| 286 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 285 | + if ($response->{'ok'} === FALSE) { |
|
| 286 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | return $json_response->getBody(); |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | try { |
| 42 | 42 | $client = new \GuzzleHttp\Client(); |
| 43 | 43 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 44 | - $response = json_decode( $json_response->getBody() ); |
|
| 44 | + $response = json_decode($json_response->getBody()); |
|
| 45 | 45 | } |
| 46 | 46 | catch (RequestException $e) { |
| 47 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 47 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if($response->{'ok'} === FALSE) { |
|
| 51 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 50 | + if ($response->{'ok'} === FALSE) { |
|
| 51 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $this; |
@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | "channel" => $channel, |
| 96 | 96 | "latest" => $latest, |
| 97 | 97 | "oldest" => $oldest, |
| 98 | - "inclusive" => (string)$inclusive, |
|
| 99 | - "count" => (string)$count, |
|
| 100 | - "unreads" => (string)$unreads |
|
| 98 | + "inclusive" => (string) $inclusive, |
|
| 99 | + "count" => (string) $count, |
|
| 100 | + "unreads" => (string) $unreads |
|
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | $this->setUrl("im.history", $arguments); |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | try { |
| 107 | 107 | $client = new \GuzzleHttp\Client(); |
| 108 | 108 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 109 | - $response = json_decode( $json_response->getBody() ); |
|
| 109 | + $response = json_decode($json_response->getBody()); |
|
| 110 | 110 | } |
| 111 | 111 | catch (RequestException $e) { |
| 112 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 112 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if($response->{'ok'} === FALSE) { |
|
| 116 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 115 | + if ($response->{'ok'} === FALSE) { |
|
| 116 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | return $json_response->getBody(); |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | try { |
| 136 | 136 | $client = new \GuzzleHttp\Client(); |
| 137 | 137 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 138 | - $response = json_decode( $json_response->getBody() ); |
|
| 138 | + $response = json_decode($json_response->getBody()); |
|
| 139 | 139 | } |
| 140 | 140 | catch (RequestException $e) { |
| 141 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 141 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if($response->{'ok'} === FALSE) { |
|
| 145 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 144 | + if ($response->{'ok'} === FALSE) { |
|
| 145 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | return $json_response->getBody(); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | // Set the arguments of the request |
| 172 | 172 | $arguments = array( |
| 173 | 173 | "channel" => $channel, |
| 174 | - "ts" => (string)$ts |
|
| 174 | + "ts" => (string) $ts |
|
| 175 | 175 | ); |
| 176 | 176 | |
| 177 | 177 | $this->setUrl("im.mark", $arguments); |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | try { |
| 181 | 181 | $client = new \GuzzleHttp\Client(); |
| 182 | 182 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 183 | - $response = json_decode( $json_response->getBody() ); |
|
| 183 | + $response = json_decode($json_response->getBody()); |
|
| 184 | 184 | } |
| 185 | 185 | catch (RequestException $e) { |
| 186 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 186 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if($response->{'ok'} === FALSE) { |
|
| 190 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 189 | + if ($response->{'ok'} === FALSE) { |
|
| 190 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $this; |
@@ -218,10 +218,10 @@ discard block |
||
| 218 | 218 | "user" => $user |
| 219 | 219 | ); |
| 220 | 220 | |
| 221 | - if(($return_im != NULL) && ($return_im === TRUE)) { |
|
| 221 | + if (($return_im != NULL) && ($return_im === TRUE)) { |
|
| 222 | 222 | $arguments["return_im"] = 1; |
| 223 | 223 | } |
| 224 | - elseif(($return_im != NULL) && ($return_im === FALSE)) { |
|
| 224 | + elseif (($return_im != NULL) && ($return_im === FALSE)) { |
|
| 225 | 225 | $arguments["return_im"] = 0; |
| 226 | 226 | } |
| 227 | 227 | |
@@ -231,14 +231,14 @@ discard block |
||
| 231 | 231 | try { |
| 232 | 232 | $client = new \GuzzleHttp\Client(); |
| 233 | 233 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 234 | - $response = json_decode( $json_response->getBody() ); |
|
| 234 | + $response = json_decode($json_response->getBody()); |
|
| 235 | 235 | } |
| 236 | 236 | catch (RequestException $e) { |
| 237 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 237 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - if($response->{'ok'} === FALSE) { |
|
| 241 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 240 | + if ($response->{'ok'} === FALSE) { |
|
| 241 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | return $json_response->getBody(); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | // Set the arguments of the request |
| 268 | 268 | $arguments = array( |
| 269 | 269 | "channel" => $channel, |
| 270 | - "thread_ts" => (string)$thread_ts |
|
| 270 | + "thread_ts" => (string) $thread_ts |
|
| 271 | 271 | ); |
| 272 | 272 | |
| 273 | 273 | $this->setUrl("im.replies", $arguments); |
@@ -276,14 +276,14 @@ discard block |
||
| 276 | 276 | try { |
| 277 | 277 | $client = new \GuzzleHttp\Client(); |
| 278 | 278 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 279 | - $response = json_decode( $json_response->getBody() ); |
|
| 279 | + $response = json_decode($json_response->getBody()); |
|
| 280 | 280 | } |
| 281 | 281 | catch (RequestException $e) { |
| 282 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 282 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - if($response->{'ok'} === FALSE) { |
|
| 286 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 285 | + if ($response->{'ok'} === FALSE) { |
|
| 286 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | return $json_response->getBody(); |