@@ -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_usergroups($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(); |