@@ -162,8 +162,7 @@ |
||
| 162 | 162 | * @param array $attachments |
| 163 | 163 | * @return Webhook |
| 164 | 164 | */ |
| 165 | - public function setAttachments($attachments) |
|
| 166 | - { |
|
| 165 | + public function setAttachments($attachments) { |
|
| 167 | 166 | if (!is_array($attachments)) { |
| 168 | 167 | throw new InvalidArgumentException('The attachments must be an array.'); |
| 169 | 168 | } |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | ]); |
| 146 | 146 | } |
| 147 | 147 | catch (RequestException $e) { |
| 148 | - throw new RuntimeException('The request to the webhook failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 148 | + throw new RuntimeException('The request to the webhook failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // We re-initialize the attachments to prevent any conflict with a future message. |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | /** |
| 67 | 67 | * {@inheritdoc} |
| 68 | 68 | * |
| 69 | - * @return Auth |
|
| 69 | + * @return \Psr\Http\Message\StreamInterface |
|
| 70 | 70 | */ |
| 71 | 71 | public function test() { |
| 72 | 72 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | "test" => $test |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - if($token != NULL) { |
|
| 42 | + if ($token != NULL) { |
|
| 43 | 43 | $arguments["token"] = $token; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -49,14 +49,14 @@ discard block |
||
| 49 | 49 | try { |
| 50 | 50 | $client = new \GuzzleHttp\Client(); |
| 51 | 51 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 52 | - $response = json_decode( $json_response->getBody() ); |
|
| 52 | + $response = json_decode($json_response->getBody()); |
|
| 53 | 53 | } |
| 54 | 54 | catch (RequestException $e) { |
| 55 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 55 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if($response->{'ok'} === FALSE) { |
|
| 59 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 58 | + if ($response->{'ok'} === FALSE) { |
|
| 59 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | return $this; |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | try { |
| 77 | 77 | $client = new \GuzzleHttp\Client(); |
| 78 | 78 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 79 | - $response = json_decode( $json_response->getBody() ); |
|
| 79 | + $response = json_decode($json_response->getBody()); |
|
| 80 | 80 | } |
| 81 | 81 | catch (RequestException $e) { |
| 82 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 82 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if($response->{'ok'} === FALSE) { |
|
| 86 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 85 | + if ($response->{'ok'} === FALSE) { |
|
| 86 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | return $json_response->getBody(); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @param float $ts |
| 24 | 24 | * @param string $channel |
| 25 | 25 | * @param string $as_user |
| 26 | - * @return Chat |
|
| 26 | + * @return \Psr\Http\Message\StreamInterface |
|
| 27 | 27 | */ |
| 28 | 28 | public function delete($ts, $channel, $as_user = NULL) { |
| 29 | 29 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @param string $channel |
| 76 | 76 | * @param string $text |
| 77 | - * @return Chat |
|
| 77 | + * @return \Psr\Http\Message\StreamInterface |
|
| 78 | 78 | */ |
| 79 | 79 | public function meMessage($channel, $text) { |
| 80 | 80 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @param string $icon_emoji |
| 130 | 130 | * @param float $thread_ts |
| 131 | 131 | * @param string $reply_broadcast |
| 132 | - * @return Chat |
|
| 132 | + * @return \Psr\Http\Message\StreamInterface |
|
| 133 | 133 | */ |
| 134 | 134 | public function postMessage($channel, $text, $parse = "none", $link_names = 1, $attachments = NULL, |
| 135 | 135 | $unfurl_links = TRUE, $unfurl_media = FALSE, $username = NULL, $as_user = TRUE, $icon_url = NULL, |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * @param string $parse |
| 236 | 236 | * @param integer $link_names |
| 237 | 237 | * @param bool $as_user |
| 238 | - * @return Chat |
|
| 238 | + * @return \Psr\Http\Message\StreamInterface |
|
| 239 | 239 | */ |
| 240 | 240 | public function update($ts, $channel, $text, $attachments = NULL, $parse = "none", $link_names = 1, $as_user = TRUE) { |
| 241 | 241 | |
@@ -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(); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * {@inheritdoc} |
| 49 | 49 | * |
| 50 | - * @return Dnd |
|
| 50 | + * @return \Psr\Http\Message\StreamInterface |
|
| 51 | 51 | */ |
| 52 | 52 | public function endSnooze() { |
| 53 | 53 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * {@inheritdoc} |
| 76 | 76 | * |
| 77 | 77 | * @param string $user |
| 78 | - * @return Dnd |
|
| 78 | + * @return \Psr\Http\Message\StreamInterface |
|
| 79 | 79 | */ |
| 80 | 80 | public function info($user = NULL) { |
| 81 | 81 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * {@inheritdoc} |
| 116 | 116 | * |
| 117 | 117 | * @param integer $num_minutes |
| 118 | - * @return Dnd |
|
| 118 | + * @return \Psr\Http\Message\StreamInterface |
|
| 119 | 119 | */ |
| 120 | 120 | public function setSnooze($num_minutes) { |
| 121 | 121 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * {@inheritdoc} |
| 154 | 154 | * |
| 155 | 155 | * @param string $users |
| 156 | - * @return Dnd |
|
| 156 | + * @return \Psr\Http\Message\StreamInterface |
|
| 157 | 157 | */ |
| 158 | 158 | public function teamInfo($users = NULL) { |
| 159 | 159 | |
@@ -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; |
@@ -57,14 +57,14 @@ discard block |
||
| 57 | 57 | try { |
| 58 | 58 | $client = new \GuzzleHttp\Client(); |
| 59 | 59 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 60 | - $response = json_decode( $json_response->getBody() ); |
|
| 60 | + $response = json_decode($json_response->getBody()); |
|
| 61 | 61 | } |
| 62 | 62 | catch (RequestException $e) { |
| 63 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 63 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if($response->{'ok'} === FALSE) { |
|
| 67 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 66 | + if ($response->{'ok'} === FALSE) { |
|
| 67 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return $json_response->getBody(); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | // Set the arguments of the request |
| 88 | 88 | $arguments = array(); |
| 89 | 89 | |
| 90 | - if($user != NULL) { |
|
| 90 | + if ($user != NULL) { |
|
| 91 | 91 | $arguments["user"] = $user; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | try { |
| 98 | 98 | $client = new \GuzzleHttp\Client(); |
| 99 | 99 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 100 | - $response = json_decode( $json_response->getBody() ); |
|
| 100 | + $response = json_decode($json_response->getBody()); |
|
| 101 | 101 | } |
| 102 | 102 | catch (RequestException $e) { |
| 103 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 103 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if($response->{'ok'} === FALSE) { |
|
| 107 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 106 | + if ($response->{'ok'} === FALSE) { |
|
| 107 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | 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(); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | // Set the arguments of the request |
| 166 | 166 | $arguments = array(); |
| 167 | 167 | |
| 168 | - if($user != NULL) { |
|
| 168 | + if ($user != NULL) { |
|
| 169 | 169 | $arguments["users"] = $users; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -175,14 +175,14 @@ discard block |
||
| 175 | 175 | try { |
| 176 | 176 | $client = new \GuzzleHttp\Client(); |
| 177 | 177 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 178 | - $response = json_decode( $json_response->getBody() ); |
|
| 178 | + $response = json_decode($json_response->getBody()); |
|
| 179 | 179 | } |
| 180 | 180 | catch (RequestException $e) { |
| 181 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 181 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - if($response->{'ok'} === FALSE) { |
|
| 185 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 184 | + if ($response->{'ok'} === FALSE) { |
|
| 185 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return $json_response->getBody(); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @param string $file |
| 63 | 63 | * @param integer $count |
| 64 | 64 | * @param integer $page |
| 65 | - * @return Files |
|
| 65 | + * @return \Psr\Http\Message\StreamInterface |
|
| 66 | 66 | */ |
| 67 | 67 | public function info($file, $count = 100, $page = 1) { |
| 68 | 68 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @param string $types |
| 116 | 116 | * @param integer $count |
| 117 | 117 | * @param integer $page |
| 118 | - * @return Files |
|
| 118 | + * @return \Psr\Http\Message\StreamInterface |
|
| 119 | 119 | */ |
| 120 | 120 | public function list($user = NULL, $channel = NULL, $ts_from = "now", $ts_to = "all", $types = "all", $count = 100, $page = 1) { |
| 121 | 121 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * {@inheritdoc} |
| 223 | 223 | * |
| 224 | 224 | * @param string $file |
| 225 | - * @return Files |
|
| 225 | + * @return \Psr\Http\Message\StreamInterface |
|
| 226 | 226 | */ |
| 227 | 227 | public function sharedPublicURL($file) { |
| 228 | 228 | |
@@ -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; |
@@ -319,7 +319,7 @@ |
||
| 319 | 319 | $client = new \GuzzleHttp\Client(); |
| 320 | 320 | $json_response = $client->request('POST', $this->getUrl(), [ |
| 321 | 321 | 'headers' => $headers, |
| 322 | - 'http_errors' => false, |
|
| 322 | + 'http_errors' => FALSE, |
|
| 323 | 323 | 'json' => $post_content |
| 324 | 324 | ]); |
| 325 | 325 | $response = json_decode( $json_response->getBody() ); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @param string $file |
| 24 | 24 | * @param string $comment |
| 25 | 25 | * @param string $channel |
| 26 | - * @return FilesComments |
|
| 26 | + * @return \Psr\Http\Message\StreamInterface |
|
| 27 | 27 | */ |
| 28 | 28 | public function add($file, $comment, $channel = NULL) { |
| 29 | 29 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @param string $file |
| 118 | 118 | * @param string $id |
| 119 | 119 | * @param string $comment |
| 120 | - * @return FilesComments |
|
| 120 | + * @return \Psr\Http\Message\StreamInterface |
|
| 121 | 121 | */ |
| 122 | 122 | public function edit($file, $id, $comment) { |
| 123 | 123 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | "comment" => $comment |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | - if($channel != NULL) { |
|
| 47 | + if ($channel != NULL) { |
|
| 48 | 48 | $arguments["channel"] = $channel; |
| 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(); |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | try { |
| 98 | 98 | $client = new \GuzzleHttp\Client(); |
| 99 | 99 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 100 | - $response = json_decode( $json_response->getBody() ); |
|
| 100 | + $response = json_decode($json_response->getBody()); |
|
| 101 | 101 | } |
| 102 | 102 | catch (RequestException $e) { |
| 103 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 103 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if($response->{'ok'} === FALSE) { |
|
| 107 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 106 | + if ($response->{'ok'} === FALSE) { |
|
| 107 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | return $this; |
@@ -145,14 +145,14 @@ discard block |
||
| 145 | 145 | try { |
| 146 | 146 | $client = new \GuzzleHttp\Client(); |
| 147 | 147 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 148 | - $response = json_decode( $json_response->getBody() ); |
|
| 148 | + $response = json_decode($json_response->getBody()); |
|
| 149 | 149 | } |
| 150 | 150 | catch (RequestException $e) { |
| 151 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 151 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if($response->{'ok'} === FALSE) { |
|
| 155 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 154 | + if ($response->{'ok'} === FALSE) { |
|
| 155 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | return $json_response->getBody(); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * @param string $client_secret |
| 25 | 25 | * @param string $code |
| 26 | 26 | * @param string $redirect_uri |
| 27 | - * @return string $response |
|
| 27 | + * @return \Psr\Http\Message\StreamInterface $response |
|
| 28 | 28 | */ |
| 29 | 29 | public function access($client_id, $client_secret, $code, $redirect_uri = NULL) { |
| 30 | 30 | |
@@ -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(); |
@@ -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($channel) { |
| 89 | 89 | |
@@ -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; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @param string $channel |
| 95 | 95 | * @param float $timestamp |
| 96 | 96 | * @param boolean $full |
| 97 | - * @return Reactions |
|
| 97 | + * @return \Psr\Http\Message\StreamInterface |
|
| 98 | 98 | */ |
| 99 | 99 | public function get($file = NULL, $file_comment = NULL, $channel = NULL, $timestamp = NULL, $full = NULL) { |
| 100 | 100 | |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | * |
| 162 | 162 | * @param string $user |
| 163 | 163 | * @param boolean $full |
| 164 | - * @param string $count |
|
| 165 | - * @param string $page |
|
| 166 | - * @return Reactions |
|
| 164 | + * @param integer $count |
|
| 165 | + * @param integer $page |
|
| 166 | + * @return \Psr\Http\Message\StreamInterface |
|
| 167 | 167 | */ |
| 168 | 168 | public function list($user = NULL, $full = NULL, $count = 100, $page = 1) { |
| 169 | 169 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $arguments["channel"] = $channel; |
| 62 | 62 | } |
| 63 | 63 | if ($timestamp != NULL) { |
| 64 | - $arguments["timestamp"] = (float)$timestamp; |
|
| 64 | + $arguments["timestamp"] = (float) $timestamp; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $this->setUrl("reactions.add", $arguments); |
@@ -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 $this; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $arguments["channel"] = $channel; |
| 129 | 129 | } |
| 130 | 130 | if ($timestamp != NULL) { |
| 131 | - $arguments["timestamp"] = (string)$timestamp; |
|
| 131 | + $arguments["timestamp"] = (string) $timestamp; |
|
| 132 | 132 | } |
| 133 | 133 | if ($full != NULL) { |
| 134 | 134 | $arguments["full"] = $full; |
@@ -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(); |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | "page" => $page |
| 188 | 188 | ); |
| 189 | 189 | |
| 190 | - if($user != NULL) { |
|
| 190 | + if ($user != NULL) { |
|
| 191 | 191 | $arguments["user"] = $user; |
| 192 | 192 | } |
| 193 | - if($full != NULL) { |
|
| 193 | + if ($full != NULL) { |
|
| 194 | 194 | $arguments["full"] = $full; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -200,14 +200,14 @@ discard block |
||
| 200 | 200 | try { |
| 201 | 201 | $client = new \GuzzleHttp\Client(); |
| 202 | 202 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 203 | - $response = json_decode( $json_response->getBody() ); |
|
| 203 | + $response = json_decode($json_response->getBody()); |
|
| 204 | 204 | } |
| 205 | 205 | catch (RequestException $e) { |
| 206 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 206 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - if($response->{'ok'} === FALSE) { |
|
| 210 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 209 | + if ($response->{'ok'} === FALSE) { |
|
| 210 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | return $json_response->getBody(); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $arguments["channel"] = $channel; |
| 261 | 261 | } |
| 262 | 262 | if ($timestamp != NULL) { |
| 263 | - $arguments["timestamp"] = (string)$timestamp; |
|
| 263 | + $arguments["timestamp"] = (string) $timestamp; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | $this->setUrl("reactions.remove", $arguments); |
@@ -269,14 +269,14 @@ discard block |
||
| 269 | 269 | try { |
| 270 | 270 | $client = new \GuzzleHttp\Client(); |
| 271 | 271 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 272 | - $response = json_decode( $json_response->getBody() ); |
|
| 272 | + $response = json_decode($json_response->getBody()); |
|
| 273 | 273 | } |
| 274 | 274 | catch (RequestException $e) { |
| 275 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 275 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - if($response->{'ok'} === FALSE) { |
|
| 279 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 278 | + if ($response->{'ok'} === FALSE) { |
|
| 279 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | return $this; |