@@ -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($count = 100, $page = 1) { |
| 91 | 91 | |
@@ -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; |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * {@inheritdoc} |
| 22 | 22 | * |
| 23 | - * @param string $count |
|
| 24 | - * @param string $page |
|
| 23 | + * @param integer $count |
|
| 24 | + * @param integer $page |
|
| 25 | 25 | * @param string $before |
| 26 | - * @return string |
|
| 26 | + * @return \Psr\Http\Message\StreamInterface |
|
| 27 | 27 | */ |
| 28 | 28 | public function accessLogs($count = 100, $page = 1, $before = NULL) { |
| 29 | 29 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * {@inheritdoc} |
| 75 | 75 | * |
| 76 | 76 | * @param string $user |
| 77 | - * @return string |
|
| 77 | + * @return \Psr\Http\Message\StreamInterface |
|
| 78 | 78 | */ |
| 79 | 79 | public function billableInfo($user = NULL) { |
| 80 | 80 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | /** |
| 116 | 116 | * {@inheritdoc} |
| 117 | 117 | * |
| 118 | - * @return string |
|
| 118 | + * @return \Psr\Http\Message\StreamInterface |
|
| 119 | 119 | */ |
| 120 | 120 | public function info() { |
| 121 | 121 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @param string $change_type |
| 152 | 152 | * @param int $count |
| 153 | 153 | * @param int $page |
| 154 | - * @return string |
|
| 154 | + * @return \Psr\Http\Message\StreamInterface |
|
| 155 | 155 | */ |
| 156 | 156 | public function integrationLogs($service_id = NULL, $app_id = NULL, $user = NULL, $change_type = NULL, $count = 100, $page = 1) { |
| 157 | 157 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * {@inheritdoc} |
| 224 | 224 | * |
| 225 | 225 | * @param string $visibility |
| 226 | - * @return string |
|
| 226 | + * @return \Psr\Http\Message\StreamInterface |
|
| 227 | 227 | */ |
| 228 | 228 | public function profileGet($visibility = NULL) { |
| 229 | 229 | |
@@ -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(); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | // Set the arguments of the request |
| 87 | 87 | $arguments = array(); |
| 88 | 88 | |
| 89 | - if($user != NULL) { |
|
| 89 | + if ($user != NULL) { |
|
| 90 | 90 | $arguments["user"] = $user; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | try { |
| 97 | 97 | $client = new \GuzzleHttp\Client(); |
| 98 | 98 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 99 | - $response = json_decode( $json_response->getBody() ); |
|
| 99 | + $response = json_decode($json_response->getBody()); |
|
| 100 | 100 | } |
| 101 | 101 | catch (RequestException $e) { |
| 102 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 102 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - if($response->{'ok'} === FALSE) { |
|
| 106 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 105 | + if ($response->{'ok'} === FALSE) { |
|
| 106 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | return $json_response->getBody(); |
@@ -125,14 +125,14 @@ discard block |
||
| 125 | 125 | try { |
| 126 | 126 | $client = new \GuzzleHttp\Client(); |
| 127 | 127 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 128 | - $response = json_decode( $json_response->getBody() ); |
|
| 128 | + $response = json_decode($json_response->getBody()); |
|
| 129 | 129 | } |
| 130 | 130 | catch (RequestException $e) { |
| 131 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 131 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if($response->{'ok'} === FALSE) { |
|
| 135 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 134 | + if ($response->{'ok'} === FALSE) { |
|
| 135 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | return $json_response->getBody(); |
@@ -178,22 +178,22 @@ discard block |
||
| 178 | 178 | // Set the arguments of the request |
| 179 | 179 | $arguments = array(); |
| 180 | 180 | |
| 181 | - if($service_id != NULL) { |
|
| 181 | + if ($service_id != NULL) { |
|
| 182 | 182 | $arguments["service_id"] = $service_id; |
| 183 | 183 | } |
| 184 | - if($app_id != NULL) { |
|
| 184 | + if ($app_id != NULL) { |
|
| 185 | 185 | $arguments["app_id"] = $app_id; |
| 186 | 186 | } |
| 187 | - if($user != NULL) { |
|
| 187 | + if ($user != NULL) { |
|
| 188 | 188 | $arguments["user"] = $user; |
| 189 | 189 | } |
| 190 | - if($change_type != NULL) { |
|
| 190 | + if ($change_type != NULL) { |
|
| 191 | 191 | $arguments["change_type"] = $change_type; |
| 192 | 192 | } |
| 193 | - if($count != NULL) { |
|
| 193 | + if ($count != NULL) { |
|
| 194 | 194 | $arguments["count"] = $count; |
| 195 | 195 | } |
| 196 | - if($page != NULL) { |
|
| 196 | + if ($page != NULL) { |
|
| 197 | 197 | $arguments["page"] = $page; |
| 198 | 198 | } |
| 199 | 199 | |
@@ -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(); |
@@ -248,14 +248,14 @@ discard block |
||
| 248 | 248 | try { |
| 249 | 249 | $client = new \GuzzleHttp\Client(); |
| 250 | 250 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 251 | - $response = json_decode( $json_response->getBody() ); |
|
| 251 | + $response = json_decode($json_response->getBody()); |
|
| 252 | 252 | } |
| 253 | 253 | catch (RequestException $e) { |
| 254 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 254 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - if($response->{'ok'} === FALSE) { |
|
| 258 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 257 | + if ($response->{'ok'} === FALSE) { |
|
| 258 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | return $json_response->getBody(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * @param string $description |
| 26 | 26 | * @param string $channels |
| 27 | 27 | * @param bool $include_count |
| 28 | - * @return string |
|
| 28 | + * @return \Psr\Http\Message\StreamInterface |
|
| 29 | 29 | */ |
| 30 | 30 | public function create($name, $handle = NULL, $description = NULL, $channels = NULL, $include_count = NULL) { |
| 31 | 31 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @param string $usergroup |
| 93 | 93 | * @param bool $include_count |
| 94 | - * @return string |
|
| 94 | + * @return \Psr\Http\Message\StreamInterface |
|
| 95 | 95 | */ |
| 96 | 96 | public function disable($usergroup, $include_count = NULL) { |
| 97 | 97 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * |
| 140 | 140 | * @param string $usergroup |
| 141 | 141 | * @param bool $include_count |
| 142 | - * @return string |
|
| 142 | + * @return \Psr\Http\Message\StreamInterface |
|
| 143 | 143 | */ |
| 144 | 144 | public function enable($usergroup, $include_count = NULL) { |
| 145 | 145 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * @param bool $include_disabled |
| 190 | 190 | * @param bool $include_count |
| 191 | 191 | * @param bool $include_users |
| 192 | - * @return string |
|
| 192 | + * @return \Psr\Http\Message\StreamInterface |
|
| 193 | 193 | */ |
| 194 | 194 | public function list($include_disabled = NULL, $include_count = NULL, $include_users = NULL) { |
| 195 | 195 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @param string $description |
| 249 | 249 | * @param string $channels |
| 250 | 250 | * @param bool $include_count |
| 251 | - * @return string |
|
| 251 | + * @return \Psr\Http\Message\StreamInterface |
|
| 252 | 252 | */ |
| 253 | 253 | public function update($usergroup, $name = NULL, $handle = NULL, $description = NULL, $channels = NULL, $include_count = NULL) { |
| 254 | 254 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * |
| 321 | 321 | * @param string $usergroup |
| 322 | 322 | * @param bool $include_disabled |
| 323 | - * @return string |
|
| 323 | + * @return \Psr\Http\Message\StreamInterface |
|
| 324 | 324 | */ |
| 325 | 325 | public function usersList($usergroup, $include_disabled = NULL) { |
| 326 | 326 | |
@@ -368,8 +368,7 @@ discard block |
||
| 368 | 368 | * |
| 369 | 369 | * @param string $usergroup |
| 370 | 370 | * @param string $users |
| 371 | - * @param bool $include_count |
|
| 372 | - * @return string |
|
| 371 | + * @return \Psr\Http\Message\StreamInterface |
|
| 373 | 372 | */ |
| 374 | 373 | public function usersUpdate($usergroup, $users, $include_disabled = NULL) { |
| 375 | 374 | |
@@ -33,16 +33,16 @@ discard block |
||
| 33 | 33 | if (!is_string($name) || ($name == NULL)) { |
| 34 | 34 | throw new InvalidArgumentException("The type of the name variable is not valid."); |
| 35 | 35 | } |
| 36 | - if (!is_string($handle) && ($name != NULL)) { |
|
| 36 | + if (!is_string($handle) && ($name != NULL)) { |
|
| 37 | 37 | throw new InvalidArgumentException("The type of the handle variable is not valid."); |
| 38 | 38 | } |
| 39 | - if (!is_string($description) && ($description != NULL)) { |
|
| 39 | + if (!is_string($description) && ($description != NULL)) { |
|
| 40 | 40 | throw new InvalidArgumentException("The type of the description variable is not valid."); |
| 41 | 41 | } |
| 42 | - if (!is_string($channels) && ($channels != NULL)) { |
|
| 42 | + if (!is_string($channels) && ($channels != NULL)) { |
|
| 43 | 43 | throw new InvalidArgumentException("The type of the channels variable is not valid."); |
| 44 | 44 | } |
| 45 | - if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 45 | + if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 46 | 46 | throw new InvalidArgumentException("The type of the channels variable is not valid."); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -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,7 +99,7 @@ discard block |
||
| 99 | 99 | if (!is_string($usergroup) || ($usergroup != NULL)) { |
| 100 | 100 | throw new InvalidArgumentException("The type of the usergroup variable is not valid."); |
| 101 | 101 | } |
| 102 | - if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 102 | + if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 103 | 103 | throw new InvalidArgumentException("The type of the include_count variable is not valid."); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -118,14 +118,14 @@ discard block |
||
| 118 | 118 | try { |
| 119 | 119 | $client = new \GuzzleHttp\Client(); |
| 120 | 120 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 121 | - $response = json_decode( $json_response->getBody() ); |
|
| 121 | + $response = json_decode($json_response->getBody()); |
|
| 122 | 122 | } |
| 123 | 123 | catch (RequestException $e) { |
| 124 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 124 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if($response->{'ok'} === FALSE) { |
|
| 128 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 127 | + if ($response->{'ok'} === FALSE) { |
|
| 128 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return $json_response->getBody(); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | if (!is_string($usergroup) || ($usergroup != NULL)) { |
| 148 | 148 | throw new InvalidArgumentException("The type of the usergroup variable is not valid."); |
| 149 | 149 | } |
| 150 | - if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 150 | + if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 151 | 151 | throw new InvalidArgumentException("The type of the include_count variable is not valid."); |
| 152 | 152 | } |
| 153 | 153 | |
@@ -166,14 +166,14 @@ discard block |
||
| 166 | 166 | try { |
| 167 | 167 | $client = new \GuzzleHttp\Client(); |
| 168 | 168 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 169 | - $response = json_decode( $json_response->getBody() ); |
|
| 169 | + $response = json_decode($json_response->getBody()); |
|
| 170 | 170 | } |
| 171 | 171 | catch (RequestException $e) { |
| 172 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 172 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - if($response->{'ok'} === FALSE) { |
|
| 176 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 175 | + if ($response->{'ok'} === FALSE) { |
|
| 176 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | return $json_response->getBody(); |
@@ -194,13 +194,13 @@ discard block |
||
| 194 | 194 | public function list($include_disabled = NULL, $include_count = NULL, $include_users = NULL) { |
| 195 | 195 | |
| 196 | 196 | // Check if the type of the variables is valid. |
| 197 | - if (!is_bool($include_disabled) && ($include_disabled != NULL)) { |
|
| 197 | + if (!is_bool($include_disabled) && ($include_disabled != NULL)) { |
|
| 198 | 198 | throw new InvalidArgumentException("The type of the include_disabled variable is not valid."); |
| 199 | 199 | } |
| 200 | - if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 200 | + if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 201 | 201 | throw new InvalidArgumentException("The type of the include_count variable is not valid."); |
| 202 | 202 | } |
| 203 | - if (!is_bool($include_users) && ($include_users != NULL)) { |
|
| 203 | + if (!is_bool($include_users) && ($include_users != NULL)) { |
|
| 204 | 204 | throw new InvalidArgumentException("The type of the include_users variable is not valid."); |
| 205 | 205 | } |
| 206 | 206 | |
@@ -223,14 +223,14 @@ discard block |
||
| 223 | 223 | try { |
| 224 | 224 | $client = new \GuzzleHttp\Client(); |
| 225 | 225 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 226 | - $response = json_decode( $json_response->getBody() ); |
|
| 226 | + $response = json_decode($json_response->getBody()); |
|
| 227 | 227 | } |
| 228 | 228 | catch (RequestException $e) { |
| 229 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 229 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - if($response->{'ok'} === FALSE) { |
|
| 233 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 232 | + if ($response->{'ok'} === FALSE) { |
|
| 233 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | return $json_response->getBody(); |
@@ -259,16 +259,16 @@ discard block |
||
| 259 | 259 | if (!is_string($name) && ($name != NULL)) { |
| 260 | 260 | throw new InvalidArgumentException("The type of the name variable is not valid."); |
| 261 | 261 | } |
| 262 | - if (!is_string($handle) && ($name != NULL)) { |
|
| 262 | + if (!is_string($handle) && ($name != NULL)) { |
|
| 263 | 263 | throw new InvalidArgumentException("The type of the handle variable is not valid."); |
| 264 | 264 | } |
| 265 | - if (!is_string($description) && ($description != NULL)) { |
|
| 265 | + if (!is_string($description) && ($description != NULL)) { |
|
| 266 | 266 | throw new InvalidArgumentException("The type of the description variable is not valid."); |
| 267 | 267 | } |
| 268 | - if (!is_string($channels) && ($channels != NULL)) { |
|
| 268 | + if (!is_string($channels) && ($channels != NULL)) { |
|
| 269 | 269 | throw new InvalidArgumentException("The type of the channels variable is not valid."); |
| 270 | 270 | } |
| 271 | - if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 271 | + if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 272 | 272 | throw new InvalidArgumentException("The type of the include_count variable is not valid."); |
| 273 | 273 | } |
| 274 | 274 | |
@@ -299,14 +299,14 @@ discard block |
||
| 299 | 299 | try { |
| 300 | 300 | $client = new \GuzzleHttp\Client(); |
| 301 | 301 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 302 | - $response = json_decode( $json_response->getBody() ); |
|
| 302 | + $response = json_decode($json_response->getBody()); |
|
| 303 | 303 | } |
| 304 | 304 | catch (RequestException $e) { |
| 305 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 305 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - if($response->{'ok'} === FALSE) { |
|
| 309 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 308 | + if ($response->{'ok'} === FALSE) { |
|
| 309 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | return $json_response->getBody(); |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | if (!is_string($usergroup) || ($usergroup == NULL)) { |
| 329 | 329 | throw new InvalidArgumentException("The type of the usergroup variable is not valid."); |
| 330 | 330 | } |
| 331 | - if (!is_bool($include_disabled) && ($include_disabled != NULL)) { |
|
| 331 | + if (!is_bool($include_disabled) && ($include_disabled != NULL)) { |
|
| 332 | 332 | throw new InvalidArgumentException("The type of the include_disabled variable is not valid."); |
| 333 | 333 | } |
| 334 | 334 | |
@@ -347,14 +347,14 @@ discard block |
||
| 347 | 347 | try { |
| 348 | 348 | $client = new \GuzzleHttp\Client(); |
| 349 | 349 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 350 | - $response = json_decode( $json_response->getBody() ); |
|
| 350 | + $response = json_decode($json_response->getBody()); |
|
| 351 | 351 | } |
| 352 | 352 | catch (RequestException $e) { |
| 353 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 353 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - if($response->{'ok'} === FALSE) { |
|
| 357 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 356 | + if ($response->{'ok'} === FALSE) { |
|
| 357 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | return $json_response->getBody(); |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | if (!is_string($users) || ($users == NULL)) { |
| 381 | 381 | throw new InvalidArgumentException("The type of the users variable is not valid."); |
| 382 | 382 | } |
| 383 | - if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 383 | + if (!is_bool($include_count) && ($include_count != NULL)) { |
|
| 384 | 384 | throw new InvalidArgumentException("The type of the include_count variable is not valid."); |
| 385 | 385 | } |
| 386 | 386 | |
@@ -400,14 +400,14 @@ discard block |
||
| 400 | 400 | try { |
| 401 | 401 | $client = new \GuzzleHttp\Client(); |
| 402 | 402 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 403 | - $response = json_decode( $json_response->getBody() ); |
|
| 403 | + $response = json_decode($json_response->getBody()); |
|
| 404 | 404 | } |
| 405 | 405 | catch (RequestException $e) { |
| 406 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 406 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - if($response->{'ok'} === FALSE) { |
|
| 410 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 409 | + if ($response->{'ok'} === FALSE) { |
|
| 410 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | return $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($presence = NULL) { |
| 166 | 166 | |
@@ -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() ); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | * @param string $user |
| 24 | 24 | * @param bool $include_labels |
| 25 | - * @return string |
|
| 25 | + * @return \Psr\Http\Message\StreamInterface |
|
| 26 | 26 | */ |
| 27 | 27 | public function get($user = NULL, $include_labels = NULL) { |
| 28 | 28 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @param string $profile |
| 74 | 74 | * @param string $name |
| 75 | 75 | * @param string $value |
| 76 | - * @return string |
|
| 76 | + * @return \Psr\Http\Message\StreamInterface |
|
| 77 | 77 | */ |
| 78 | 78 | public function set($user = NULL, $profile = NULL, $name = NULL, $value = NULL) { |
| 79 | 79 | |
@@ -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 $json_response->getBody(); |
@@ -113,14 +113,14 @@ discard block |
||
| 113 | 113 | try { |
| 114 | 114 | $client = new \GuzzleHttp\Client(); |
| 115 | 115 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 116 | - $response = json_decode( $json_response->getBody() ); |
|
| 116 | + $response = json_decode($json_response->getBody()); |
|
| 117 | 117 | } |
| 118 | 118 | catch (RequestException $e) { |
| 119 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 119 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if($response->{'ok'} === FALSE) { |
|
| 123 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 122 | + if ($response->{'ok'} === FALSE) { |
|
| 123 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return $json_response->getBody(); |
@@ -76,15 +76,15 @@ |
||
| 76 | 76 | foreach ($arguments as $key => $value) { |
| 77 | 77 | $arguments_list[] = $key . "=" . $value; |
| 78 | 78 | |
| 79 | - if(strcmp($key, "token") == 0) { |
|
| 79 | + if (strcmp($key, "token") == 0) { |
|
| 80 | 80 | $token_is_set = TRUE; |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // If the token has not been set, add it to the list |
| 86 | - if(!$token_is_set && isset($this->token) && is_string($this->token)) { |
|
| 87 | - $arguments_list[] = "token=".$this->token; |
|
| 86 | + if (!$token_is_set && isset($this->token) && is_string($this->token)) { |
|
| 87 | + $arguments_list[] = "token=" . $this->token; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $this->url = self::SLACK_API_URL . $method . "?" . implode("&", $arguments_list); |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | try { |
| 42 | 42 | $client = new \GuzzleHttp\Client(); |
| 43 | 43 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 44 | - $response = json_decode( $json_response->getBody() ); |
|
| 44 | + $response = json_decode($json_response->getBody()); |
|
| 45 | 45 | } |
| 46 | 46 | catch (RequestException $e) { |
| 47 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 47 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if($response->{'ok'} === FALSE) { |
|
| 51 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 50 | + if ($response->{'ok'} === FALSE) { |
|
| 51 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $this; |
@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | try { |
| 81 | 81 | $client = new \GuzzleHttp\Client(); |
| 82 | 82 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 83 | - $response = json_decode( $json_response->getBody() ); |
|
| 83 | + $response = json_decode($json_response->getBody()); |
|
| 84 | 84 | } |
| 85 | 85 | catch (RequestException $e) { |
| 86 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 86 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if($response->{'ok'} === FALSE) { |
|
| 90 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 89 | + if ($response->{'ok'} === FALSE) { |
|
| 90 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return $json_response->getBody(); |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | try { |
| 142 | 142 | $client = new \GuzzleHttp\Client(); |
| 143 | 143 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 144 | - $response = json_decode( $json_response->getBody() ); |
|
| 144 | + $response = json_decode($json_response->getBody()); |
|
| 145 | 145 | } |
| 146 | 146 | catch (RequestException $e) { |
| 147 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 147 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if($response->{'ok'} === FALSE) { |
|
| 151 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 150 | + if ($response->{'ok'} === FALSE) { |
|
| 151 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $json_response->getBody(); |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | try { |
| 181 | 181 | $client = new \GuzzleHttp\Client(); |
| 182 | 182 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 183 | - $response = json_decode( $json_response->getBody() ); |
|
| 183 | + $response = json_decode($json_response->getBody()); |
|
| 184 | 184 | } |
| 185 | 185 | catch (RequestException $e) { |
| 186 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 186 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if($response->{'ok'} === FALSE) { |
|
| 190 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 189 | + if ($response->{'ok'} === FALSE) { |
|
| 190 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $json_response->getBody(); |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | try { |
| 225 | 225 | $client = new \GuzzleHttp\Client(); |
| 226 | 226 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 227 | - $response = json_decode( $json_response->getBody() ); |
|
| 227 | + $response = json_decode($json_response->getBody()); |
|
| 228 | 228 | } |
| 229 | 229 | catch (RequestException $e) { |
| 230 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 230 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - if($response->{'ok'} === FALSE) { |
|
| 234 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 233 | + if ($response->{'ok'} === FALSE) { |
|
| 234 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | return $json_response->getBody(); |
@@ -263,14 +263,14 @@ discard block |
||
| 263 | 263 | try { |
| 264 | 264 | $client = new \GuzzleHttp\Client(); |
| 265 | 265 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 266 | - $response = json_decode( $json_response->getBody() ); |
|
| 266 | + $response = json_decode($json_response->getBody()); |
|
| 267 | 267 | } |
| 268 | 268 | catch (RequestException $e) { |
| 269 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 269 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - if($response->{'ok'} === FALSE) { |
|
| 273 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 272 | + if ($response->{'ok'} === FALSE) { |
|
| 273 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | return $json_response->getBody(); |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | try { |
| 308 | 308 | $client = new \GuzzleHttp\Client(); |
| 309 | 309 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 310 | - $response = json_decode( $json_response->getBody() ); |
|
| 310 | + $response = json_decode($json_response->getBody()); |
|
| 311 | 311 | } |
| 312 | 312 | catch (RequestException $e) { |
| 313 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 313 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - if($response->{'ok'} === FALSE) { |
|
| 317 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 316 | + if ($response->{'ok'} === FALSE) { |
|
| 317 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | return $this; |
@@ -346,14 +346,14 @@ discard block |
||
| 346 | 346 | try { |
| 347 | 347 | $client = new \GuzzleHttp\Client(); |
| 348 | 348 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 349 | - $response = json_decode( $json_response->getBody() ); |
|
| 349 | + $response = json_decode($json_response->getBody()); |
|
| 350 | 350 | } |
| 351 | 351 | catch (RequestException $e) { |
| 352 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 352 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | - if($response->{'ok'} === FALSE) { |
|
| 356 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 355 | + if ($response->{'ok'} === FALSE) { |
|
| 356 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | return $this; |
@@ -385,14 +385,14 @@ discard block |
||
| 385 | 385 | try { |
| 386 | 386 | $client = new \GuzzleHttp\Client(); |
| 387 | 387 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 388 | - $response = json_decode( $json_response->getBody() ); |
|
| 388 | + $response = json_decode($json_response->getBody()); |
|
| 389 | 389 | } |
| 390 | 390 | catch (RequestException $e) { |
| 391 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 391 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - if($response->{'ok'} === FALSE) { |
|
| 395 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 394 | + if ($response->{'ok'} === FALSE) { |
|
| 395 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | return $json_response->getBody(); |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | // Set the arguments of the request |
| 421 | 421 | $arguments = array( |
| 422 | 422 | "channel" => $channel, |
| 423 | - "ts" => (string)$ts |
|
| 423 | + "ts" => (string) $ts |
|
| 424 | 424 | ); |
| 425 | 425 | |
| 426 | 426 | $this->setUrl("channels.mark", $arguments); |
@@ -429,14 +429,14 @@ discard block |
||
| 429 | 429 | try { |
| 430 | 430 | $client = new \GuzzleHttp\Client(); |
| 431 | 431 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 432 | - $response = json_decode( $json_response->getBody() ); |
|
| 432 | + $response = json_decode($json_response->getBody()); |
|
| 433 | 433 | } |
| 434 | 434 | catch (RequestException $e) { |
| 435 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 435 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | - if($response->{'ok'} === FALSE) { |
|
| 439 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 438 | + if ($response->{'ok'} === FALSE) { |
|
| 439 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | return $this; |
@@ -478,14 +478,14 @@ discard block |
||
| 478 | 478 | try { |
| 479 | 479 | $client = new \GuzzleHttp\Client(); |
| 480 | 480 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 481 | - $response = json_decode( $json_response->getBody() ); |
|
| 481 | + $response = json_decode($json_response->getBody()); |
|
| 482 | 482 | } |
| 483 | 483 | catch (RequestException $e) { |
| 484 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 484 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | - if($response->{'ok'} === FALSE) { |
|
| 488 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 487 | + if ($response->{'ok'} === FALSE) { |
|
| 488 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | return $json_response->getBody(); |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | // Set the arguments of the request |
| 514 | 514 | $arguments = array( |
| 515 | 515 | "channel" => $channel, |
| 516 | - "thread_ts" => (string)$thread_ts |
|
| 516 | + "thread_ts" => (string) $thread_ts |
|
| 517 | 517 | ); |
| 518 | 518 | |
| 519 | 519 | $this->setUrl("channels.replies", $arguments); |
@@ -522,14 +522,14 @@ discard block |
||
| 522 | 522 | try { |
| 523 | 523 | $client = new \GuzzleHttp\Client(); |
| 524 | 524 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 525 | - $response = json_decode( $json_response->getBody() ); |
|
| 525 | + $response = json_decode($json_response->getBody()); |
|
| 526 | 526 | } |
| 527 | 527 | catch (RequestException $e) { |
| 528 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 528 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - if($response->{'ok'} === FALSE) { |
|
| 532 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 531 | + if ($response->{'ok'} === FALSE) { |
|
| 532 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | return $json_response->getBody(); |
@@ -566,14 +566,14 @@ discard block |
||
| 566 | 566 | try { |
| 567 | 567 | $client = new \GuzzleHttp\Client(); |
| 568 | 568 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 569 | - $response = json_decode( $json_response->getBody() ); |
|
| 569 | + $response = json_decode($json_response->getBody()); |
|
| 570 | 570 | } |
| 571 | 571 | catch (RequestException $e) { |
| 572 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 572 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - if($response->{'ok'} === FALSE) { |
|
| 576 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 575 | + if ($response->{'ok'} === FALSE) { |
|
| 576 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | return $this; |
@@ -610,14 +610,14 @@ discard block |
||
| 610 | 610 | try { |
| 611 | 611 | $client = new \GuzzleHttp\Client(); |
| 612 | 612 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 613 | - $response = json_decode( $json_response->getBody() ); |
|
| 613 | + $response = json_decode($json_response->getBody()); |
|
| 614 | 614 | } |
| 615 | 615 | catch (RequestException $e) { |
| 616 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 616 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 617 | 617 | } |
| 618 | 618 | |
| 619 | - if($response->{'ok'} === FALSE) { |
|
| 620 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 619 | + if ($response->{'ok'} === FALSE) { |
|
| 620 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | return $this; |
@@ -649,14 +649,14 @@ discard block |
||
| 649 | 649 | try { |
| 650 | 650 | $client = new \GuzzleHttp\Client(); |
| 651 | 651 | $json_response = $client->request('GET', $this->getUrl(), []); |
| 652 | - $response = json_decode( $json_response->getBody() ); |
|
| 652 | + $response = json_decode($json_response->getBody()); |
|
| 653 | 653 | } |
| 654 | 654 | catch (RequestException $e) { |
| 655 | - throw new RuntimeException('The request to the API failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 655 | + throw new RuntimeException('The request to the API failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 656 | 656 | } |
| 657 | 657 | |
| 658 | - if($response->{'ok'} === FALSE) { |
|
| 659 | - throw new RuntimeException('The request to the API failed: '.$response->{'error'}."."); |
|
| 658 | + if ($response->{'ok'} === FALSE) { |
|
| 659 | + throw new RuntimeException('The request to the API failed: ' . $response->{'error'} . "."); |
|
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | return $this; |
@@ -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(); |