@@ -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; |
@@ -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(); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param string $text |
24 | 24 | * @param integer $time |
25 | 25 | * @param string $user |
26 | - * @return Reminders |
|
26 | + * @return \Psr\Http\Message\StreamInterface |
|
27 | 27 | */ |
28 | 28 | public function add($text, $time, $user = NULL) { |
29 | 29 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * {@inheritdoc} |
155 | 155 | * |
156 | 156 | * @param string $reminder |
157 | - * @return string |
|
157 | + * @return \Psr\Http\Message\StreamInterface |
|
158 | 158 | */ |
159 | 159 | public function info($reminder) { |
160 | 160 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | /** |
194 | 194 | * {@inheritdoc} |
195 | 195 | * |
196 | - * @return string |
|
196 | + * @return \Psr\Http\Message\StreamInterface |
|
197 | 197 | */ |
198 | 198 | public function list_reminders() { |
199 | 199 |
@@ -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; |
@@ -277,7 +277,7 @@ |
||
277 | 277 | try { |
278 | 278 | $client = new \GuzzleHttp\Client(); |
279 | 279 | $json_response = $client->request('POST', $this->getUrl(), [ |
280 | - 'http_errors' => false, |
|
280 | + 'http_errors' => FALSE, |
|
281 | 281 | 'multipart' => $arguments |
282 | 282 | ]); |
283 | 283 | $response = json_decode( $json_response->getBody() ); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * {@inheritdoc} |
51 | 51 | * |
52 | 52 | * @param string $user |
53 | - * @return string |
|
53 | + * @return \Psr\Http\Message\StreamInterface |
|
54 | 54 | */ |
55 | 55 | public function getPresence($user) { |
56 | 56 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | /** |
90 | 90 | * {@inheritdoc} |
91 | 91 | * |
92 | - * @return string |
|
92 | + * @return \Psr\Http\Message\StreamInterface |
|
93 | 93 | */ |
94 | 94 | public function identity() { |
95 | 95 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * {@inheritdoc} |
121 | 121 | * |
122 | 122 | * @param string $user |
123 | - * @return string |
|
123 | + * @return \Psr\Http\Message\StreamInterface |
|
124 | 124 | */ |
125 | 125 | public function info($user) { |
126 | 126 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * {@inheritdoc} |
161 | 161 | * |
162 | 162 | * @param bool $presence |
163 | - * @return string |
|
163 | + * @return \Psr\Http\Message\StreamInterface |
|
164 | 164 | */ |
165 | 165 | public function list_users($presence = NULL) { |
166 | 166 |
@@ -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(); |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | // Set the arguments of the request |
38 | 38 | $arguments = array(); |
39 | 39 | |
40 | - if($error != NULL) { |
|
40 | + if ($error != NULL) { |
|
41 | 41 | $arguments["error"] = $error; |
42 | 42 | } |
43 | - if($foo != NULL) { |
|
43 | + if ($foo != NULL) { |
|
44 | 44 | $arguments["foo"] = $foo; |
45 | 45 | } |
46 | 46 | |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | try { |
51 | 51 | $client = new \GuzzleHttp\Client(); |
52 | 52 | $json_response = $client->request('GET', $this->getUrl(), []); |
53 | - $response = json_decode( $json_response->getBody() ); |
|
53 | + $response = json_decode($json_response->getBody()); |
|
54 | 54 | } |
55 | 55 | catch (RequestException $e) { |
56 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
56 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
57 | 57 | } |
58 | 58 | |
59 | - if($response->{'ok'} === FALSE) { |
|
60 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
59 | + if ($response->{'ok'} === FALSE) { |
|
60 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | 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; |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | try { |
82 | 82 | $client = new \GuzzleHttp\Client(); |
83 | 83 | $json_response = $client->request('GET', $this->getUrl(), []); |
84 | - $response = json_decode( $json_response->getBody() ); |
|
84 | + $response = json_decode($json_response->getBody()); |
|
85 | 85 | } |
86 | 86 | catch (RequestException $e) { |
87 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
87 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
88 | 88 | } |
89 | 89 | |
90 | - if($response->{'ok'} === FALSE) { |
|
91 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
90 | + if ($response->{'ok'} === FALSE) { |
|
91 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | return $json_response->getBody(); |
@@ -121,14 +121,14 @@ discard block |
||
121 | 121 | try { |
122 | 122 | $client = new \GuzzleHttp\Client(); |
123 | 123 | $json_response = $client->request('GET', $this->getUrl(), []); |
124 | - $response = json_decode( $json_response->getBody() ); |
|
124 | + $response = json_decode($json_response->getBody()); |
|
125 | 125 | } |
126 | 126 | catch (RequestException $e) { |
127 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
127 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
128 | 128 | } |
129 | 129 | |
130 | - if($response->{'ok'} === FALSE) { |
|
131 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
130 | + if ($response->{'ok'} === FALSE) { |
|
131 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | return $json_response->getBody(); |
@@ -161,14 +161,14 @@ discard block |
||
161 | 161 | try { |
162 | 162 | $client = new \GuzzleHttp\Client(); |
163 | 163 | $json_response = $client->request('GET', $this->getUrl(), []); |
164 | - $response = json_decode( $json_response->getBody() ); |
|
164 | + $response = json_decode($json_response->getBody()); |
|
165 | 165 | } |
166 | 166 | catch (RequestException $e) { |
167 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
167 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
168 | 168 | } |
169 | 169 | |
170 | - if($response->{'ok'} === FALSE) { |
|
171 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
170 | + if ($response->{'ok'} === FALSE) { |
|
171 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | return $json_response->getBody(); |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | "channel" => $channel, |
216 | 216 | "latest" => $latest, |
217 | 217 | "oldest" => $oldest, |
218 | - "inclusive" => (string)$inclusive, |
|
219 | - "count" => (string)$count, |
|
220 | - "unreads" => (string)$unreads |
|
218 | + "inclusive" => (string) $inclusive, |
|
219 | + "count" => (string) $count, |
|
220 | + "unreads" => (string) $unreads |
|
221 | 221 | ); |
222 | 222 | |
223 | 223 | $this->setUrl("groups.history", $arguments); |
@@ -226,14 +226,14 @@ discard block |
||
226 | 226 | try { |
227 | 227 | $client = new \GuzzleHttp\Client(); |
228 | 228 | $json_response = $client->request('GET', $this->getUrl(), []); |
229 | - $response = json_decode( $json_response->getBody() ); |
|
229 | + $response = json_decode($json_response->getBody()); |
|
230 | 230 | } |
231 | 231 | catch (RequestException $e) { |
232 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
232 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
233 | 233 | } |
234 | 234 | |
235 | - if($response->{'ok'} === FALSE) { |
|
236 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
235 | + if ($response->{'ok'} === FALSE) { |
|
236 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | return $json_response->getBody(); |
@@ -266,14 +266,14 @@ discard block |
||
266 | 266 | try { |
267 | 267 | $client = new \GuzzleHttp\Client(); |
268 | 268 | $json_response = $client->request('GET', $this->getUrl(), []); |
269 | - $response = json_decode( $json_response->getBody() ); |
|
269 | + $response = json_decode($json_response->getBody()); |
|
270 | 270 | } |
271 | 271 | catch (RequestException $e) { |
272 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
272 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
273 | 273 | } |
274 | 274 | |
275 | - if($response->{'ok'} === FALSE) { |
|
276 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
275 | + if ($response->{'ok'} === FALSE) { |
|
276 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | return $json_response->getBody(); |
@@ -311,14 +311,14 @@ discard block |
||
311 | 311 | try { |
312 | 312 | $client = new \GuzzleHttp\Client(); |
313 | 313 | $json_response = $client->request('GET', $this->getUrl(), []); |
314 | - $response = json_decode( $json_response->getBody() ); |
|
314 | + $response = json_decode($json_response->getBody()); |
|
315 | 315 | } |
316 | 316 | catch (RequestException $e) { |
317 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
317 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
318 | 318 | } |
319 | 319 | |
320 | - if($response->{'ok'} === FALSE) { |
|
321 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
320 | + if ($response->{'ok'} === FALSE) { |
|
321 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | return $json_response->getBody(); |
@@ -356,14 +356,14 @@ discard block |
||
356 | 356 | try { |
357 | 357 | $client = new \GuzzleHttp\Client(); |
358 | 358 | $json_response = $client->request('GET', $this->getUrl(), []); |
359 | - $response = json_decode( $json_response->getBody() ); |
|
359 | + $response = json_decode($json_response->getBody()); |
|
360 | 360 | } |
361 | 361 | catch (RequestException $e) { |
362 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
362 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
363 | 363 | } |
364 | 364 | |
365 | - if($response->{'ok'} === FALSE) { |
|
366 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
365 | + if ($response->{'ok'} === FALSE) { |
|
366 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | return $this; |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | try { |
397 | 397 | $client = new \GuzzleHttp\Client(); |
398 | 398 | $json_response = $client->request('GET', $this->getUrl(), []); |
399 | - $response = json_decode( $json_response->getBody() ); |
|
399 | + $response = json_decode($json_response->getBody()); |
|
400 | 400 | } |
401 | 401 | catch (RequestException $e) { |
402 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
402 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
403 | 403 | } |
404 | 404 | |
405 | - if($response->{'ok'} === FALSE) { |
|
406 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
405 | + if ($response->{'ok'} === FALSE) { |
|
406 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | return $this; |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | |
428 | 428 | // Set the arguments of the request |
429 | 429 | $arguments = array( |
430 | - "exclude_archived" => (string)$exclude_archived |
|
430 | + "exclude_archived" => (string) $exclude_archived |
|
431 | 431 | ); |
432 | 432 | |
433 | 433 | $this->setUrl("groups.list", $arguments); |
@@ -436,14 +436,14 @@ discard block |
||
436 | 436 | try { |
437 | 437 | $client = new \GuzzleHttp\Client(); |
438 | 438 | $json_response = $client->request('GET', $this->getUrl(), []); |
439 | - $response = json_decode( $json_response->getBody() ); |
|
439 | + $response = json_decode($json_response->getBody()); |
|
440 | 440 | } |
441 | 441 | catch (RequestException $e) { |
442 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
442 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
443 | 443 | } |
444 | 444 | |
445 | - if($response->{'ok'} === FALSE) { |
|
446 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
445 | + if ($response->{'ok'} === FALSE) { |
|
446 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | return $json_response->getBody(); |
@@ -481,14 +481,14 @@ discard block |
||
481 | 481 | try { |
482 | 482 | $client = new \GuzzleHttp\Client(); |
483 | 483 | $json_response = $client->request('GET', $this->getUrl(), []); |
484 | - $response = json_decode( $json_response->getBody() ); |
|
484 | + $response = json_decode($json_response->getBody()); |
|
485 | 485 | } |
486 | 486 | catch (RequestException $e) { |
487 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
487 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
488 | 488 | } |
489 | 489 | |
490 | - if($response->{'ok'} === FALSE) { |
|
491 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
490 | + if ($response->{'ok'} === FALSE) { |
|
491 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | return $this; |
@@ -521,14 +521,14 @@ discard block |
||
521 | 521 | try { |
522 | 522 | $client = new \GuzzleHttp\Client(); |
523 | 523 | $json_response = $client->request('GET', $this->getUrl(), []); |
524 | - $response = json_decode( $json_response->getBody() ); |
|
524 | + $response = json_decode($json_response->getBody()); |
|
525 | 525 | } |
526 | 526 | catch (RequestException $e) { |
527 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
527 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
528 | 528 | } |
529 | 529 | |
530 | - if($response->{'ok'} === FALSE) { |
|
531 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
530 | + if ($response->{'ok'} === FALSE) { |
|
531 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
532 | 532 | } |
533 | 533 | |
534 | 534 | 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 $json_response->getBody(); |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | // Set the arguments of the request |
603 | 603 | $arguments = array( |
604 | 604 | "channel" => $channel, |
605 | - "thread_ts" => (string)$thread_ts |
|
605 | + "thread_ts" => (string) $thread_ts |
|
606 | 606 | ); |
607 | 607 | |
608 | 608 | $this->setUrl("groups.replies", $arguments); |
@@ -611,14 +611,14 @@ discard block |
||
611 | 611 | try { |
612 | 612 | $client = new \GuzzleHttp\Client(); |
613 | 613 | $json_response = $client->request('GET', $this->getUrl(), []); |
614 | - $response = json_decode( $json_response->getBody() ); |
|
614 | + $response = json_decode($json_response->getBody()); |
|
615 | 615 | } |
616 | 616 | catch (RequestException $e) { |
617 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
617 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
618 | 618 | } |
619 | 619 | |
620 | - if($response->{'ok'} === FALSE) { |
|
621 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
620 | + if ($response->{'ok'} === FALSE) { |
|
621 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | return $json_response->getBody(); |
@@ -656,14 +656,14 @@ discard block |
||
656 | 656 | try { |
657 | 657 | $client = new \GuzzleHttp\Client(); |
658 | 658 | $json_response = $client->request('GET', $this->getUrl(), []); |
659 | - $response = json_decode( $json_response->getBody() ); |
|
659 | + $response = json_decode($json_response->getBody()); |
|
660 | 660 | } |
661 | 661 | catch (RequestException $e) { |
662 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
662 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
663 | 663 | } |
664 | 664 | |
665 | - if($response->{'ok'} === FALSE) { |
|
666 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
665 | + if ($response->{'ok'} === FALSE) { |
|
666 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | return $this; |
@@ -701,14 +701,14 @@ discard block |
||
701 | 701 | try { |
702 | 702 | $client = new \GuzzleHttp\Client(); |
703 | 703 | $json_response = $client->request('GET', $this->getUrl(), []); |
704 | - $response = json_decode( $json_response->getBody() ); |
|
704 | + $response = json_decode($json_response->getBody()); |
|
705 | 705 | } |
706 | 706 | catch (RequestException $e) { |
707 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
707 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
708 | 708 | } |
709 | 709 | |
710 | - if($response->{'ok'} === FALSE) { |
|
711 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
710 | + if ($response->{'ok'} === FALSE) { |
|
711 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
712 | 712 | } |
713 | 713 | |
714 | 714 | return $this; |
@@ -741,14 +741,14 @@ discard block |
||
741 | 741 | try { |
742 | 742 | $client = new \GuzzleHttp\Client(); |
743 | 743 | $json_response = $client->request('GET', $this->getUrl(), []); |
744 | - $response = json_decode( $json_response->getBody() ); |
|
744 | + $response = json_decode($json_response->getBody()); |
|
745 | 745 | } |
746 | 746 | catch (RequestException $e) { |
747 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
747 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
748 | 748 | } |
749 | 749 | |
750 | - if($response->{'ok'} === FALSE) { |
|
751 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
750 | + if ($response->{'ok'} === FALSE) { |
|
751 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
752 | 752 | } |
753 | 753 | |
754 | 754 | return $this; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $arguments["file_comment"] = $file_comment; |
55 | 55 | } |
56 | 56 | if ($timestamp != NULL) { |
57 | - $arguments["timestamp"] = (string)$timestamp; |
|
57 | + $arguments["timestamp"] = (string) $timestamp; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $this->setUrl("pin.add", $arguments); |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | try { |
64 | 64 | $client = new \GuzzleHttp\Client(); |
65 | 65 | $json_response = $client->request('GET', $this->getUrl(), []); |
66 | - $response = json_decode( $json_response->getBody() ); |
|
66 | + $response = json_decode($json_response->getBody()); |
|
67 | 67 | } |
68 | 68 | catch (RequestException $e) { |
69 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
69 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
70 | 70 | } |
71 | 71 | |
72 | - if($response->{'ok'} === FALSE) { |
|
73 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
72 | + if ($response->{'ok'} === FALSE) { |
|
73 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $this; |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | try { |
104 | 104 | $client = new \GuzzleHttp\Client(); |
105 | 105 | $json_response = $client->request('GET', $this->getUrl(), []); |
106 | - $response = json_decode( $json_response->getBody() ); |
|
106 | + $response = json_decode($json_response->getBody()); |
|
107 | 107 | } |
108 | 108 | catch (RequestException $e) { |
109 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
109 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
110 | 110 | } |
111 | 111 | |
112 | - if($response->{'ok'} === FALSE) { |
|
113 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
112 | + if ($response->{'ok'} === FALSE) { |
|
113 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return $json_response->getBody(); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $arguments["file_comment"] = $file_comment; |
157 | 157 | } |
158 | 158 | if ($timestamp != NULL) { |
159 | - $arguments["timestamp"] = (string)$timestamp; |
|
159 | + $arguments["timestamp"] = (string) $timestamp; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | $this->setUrl("pin.remove", $arguments); |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | try { |
166 | 166 | $client = new \GuzzleHttp\Client(); |
167 | 167 | $json_response = $client->request('GET', $this->getUrl(), []); |
168 | - $response = json_decode( $json_response->getBody() ); |
|
168 | + $response = json_decode($json_response->getBody()); |
|
169 | 169 | } |
170 | 170 | catch (RequestException $e) { |
171 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
171 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
172 | 172 | } |
173 | 173 | |
174 | - if($response->{'ok'} === FALSE) { |
|
175 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
174 | + if ($response->{'ok'} === FALSE) { |
|
175 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return $this; |
@@ -83,7 +83,7 @@ |
||
83 | 83 | * {@inheritdoc} |
84 | 84 | * |
85 | 85 | * @param string $channel |
86 | - * @return string |
|
86 | + * @return \Psr\Http\Message\StreamInterface |
|
87 | 87 | */ |
88 | 88 | public function list_pin($channel) { |
89 | 89 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $arguments["channel"] = $channel; |
56 | 56 | } |
57 | 57 | if ($timestamp != NULL) { |
58 | - $arguments["timestamp"] = (string)$timestamp; |
|
58 | + $arguments["timestamp"] = (string) $timestamp; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $this->setUrl("stars.add", $arguments); |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | try { |
65 | 65 | $client = new \GuzzleHttp\Client(); |
66 | 66 | $json_response = $client->request('GET', $this->getUrl(), []); |
67 | - $response = json_decode( $json_response->getBody() ); |
|
67 | + $response = json_decode($json_response->getBody()); |
|
68 | 68 | } |
69 | 69 | catch (RequestException $e) { |
70 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
70 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
71 | 71 | } |
72 | 72 | |
73 | - if($response->{'ok'} === FALSE) { |
|
74 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
73 | + if ($response->{'ok'} === FALSE) { |
|
74 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $this; |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | try { |
110 | 110 | $client = new \GuzzleHttp\Client(); |
111 | 111 | $json_response = $client->request('GET', $this->getUrl(), []); |
112 | - $response = json_decode( $json_response->getBody() ); |
|
112 | + $response = json_decode($json_response->getBody()); |
|
113 | 113 | } |
114 | 114 | catch (RequestException $e) { |
115 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
115 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
116 | 116 | } |
117 | 117 | |
118 | - if($response->{'ok'} === FALSE) { |
|
119 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
118 | + if ($response->{'ok'} === FALSE) { |
|
119 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return $json_response->getBody(); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $arguments["channel"] = $channel; |
164 | 164 | } |
165 | 165 | if ($timestamp != NULL) { |
166 | - $arguments["timestamp"] = (float)$timestamp; |
|
166 | + $arguments["timestamp"] = (float) $timestamp; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | $this->setUrl("stars.remove", $arguments); |
@@ -172,14 +172,14 @@ discard block |
||
172 | 172 | try { |
173 | 173 | $client = new \GuzzleHttp\Client(); |
174 | 174 | $json_response = $client->request('GET', $this->getUrl(), []); |
175 | - $response = json_decode( $json_response->getBody() ); |
|
175 | + $response = json_decode($json_response->getBody()); |
|
176 | 176 | } |
177 | 177 | catch (RequestException $e) { |
178 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
178 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
179 | 179 | } |
180 | 180 | |
181 | - if($response->{'ok'} === FALSE) { |
|
182 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
181 | + if ($response->{'ok'} === FALSE) { |
|
182 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | return $this; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * |
86 | 86 | * @param int $count |
87 | 87 | * @param int $page |
88 | - * @return string |
|
88 | + * @return \Psr\Http\Message\StreamInterface |
|
89 | 89 | */ |
90 | 90 | public function list_stars($count = 100, $page = 1) { |
91 | 91 |