@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @return json|false Json with data or error, or False when something went fully wrong |
23 | 23 | */ |
24 | - public function getUsers($opts = []) |
|
24 | + public function getUsers($opts = [ ]) |
|
25 | 25 | { |
26 | 26 | $query = ''; |
27 | 27 | |
28 | - if(isset($opts['search'])) $query .= '?search='.$opts['search']; |
|
28 | + if (isset($opts[ 'search' ])) $query .= '?search='.$opts[ 'search' ]; |
|
29 | 29 | |
30 | 30 | $endpoint = '/users'.$query; |
31 | 31 | return $this->doRequest('GET', $endpoint); |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | * @param string|false $email Email (Optional) |
54 | 54 | * @return json|false Json with data or error, or False when something went fully wrong |
55 | 55 | */ |
56 | - public function addUser($username, $password, $name=false, $email=false) |
|
56 | + public function addUser($username, $password, $name = false, $email = false) |
|
57 | 57 | { |
58 | 58 | $endpoint = '/users'; |
59 | - return $this->doRequest('POST', $endpoint, compact('username', 'password','name','email')); |
|
59 | + return $this->doRequest('POST', $endpoint, compact('username', 'password', 'name', 'email')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | * @param string[]|false $groups Groups (Optional) |
83 | 83 | * @return json|false Json with data or error, or False when something went fully wrong |
84 | 84 | */ |
85 | - public function updateUser($username, $password, $name=false, $email=false, $groups=false) |
|
85 | + public function updateUser($username, $password, $name = false, $email = false, $groups = false) |
|
86 | 86 | { |
87 | 87 | $endpoint = '/users/'.$username; |
88 | - return $this->doRequest('PUT', $endpoint, compact('username', 'password','name','email', 'groups')); |
|
88 | + return $this->doRequest('PUT', $endpoint, compact('username', 'password', 'name', 'email', 'groups')); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | public function addToGroup($username, $groupName) |
125 | 125 | { |
126 | 126 | $endpoint = '/users/'.$username.'/groups/'.$groupName; |
127 | - return $this->doRequest('POST', $endpoint ); |
|
127 | + return $this->doRequest('POST', $endpoint); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | public function deleteFromGroup($username, $groupName) |
139 | 139 | { |
140 | 140 | $endpoint = '/users/'.$username.'/groups/'.$groupName; |
141 | - return $this->doRequest('DELETE', $endpoint ); |
|
141 | + return $this->doRequest('DELETE', $endpoint); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | public function userRosters($username) |
178 | 178 | { |
179 | 179 | $endpoint = '/users/'.$username.'/roster'; |
180 | - return $this->doRequest('GET', $endpoint, compact('jid','name','subscriptionType')); |
|
180 | + return $this->doRequest('GET', $endpoint, compact('jid', 'name', 'subscriptionType')); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | * @param int|false $subscriptionType Subscription (Optional) |
191 | 191 | * @return json|false Json with data or error, or False when something went fully wrong |
192 | 192 | */ |
193 | - public function addToRoster($username, $jid, $name=false, $subscriptionType=false) |
|
193 | + public function addToRoster($username, $jid, $name = false, $subscriptionType = false) |
|
194 | 194 | { |
195 | 195 | $endpoint = '/users/'.$username.'/roster'; |
196 | - return $this->doRequest('POST', $endpoint, compact('jid','name','subscriptionType')); |
|
196 | + return $this->doRequest('POST', $endpoint, compact('jid', 'name', 'subscriptionType')); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | * @param int|false $subscriptionType Subscription (Optional) |
220 | 220 | * @return json|false Json with data or error, or False when something went fully wrong |
221 | 221 | */ |
222 | - public function updateRoster($username, $jid, $nickname=false, $subscriptionType=false) |
|
222 | + public function updateRoster($username, $jid, $nickname = false, $subscriptionType = false) |
|
223 | 223 | { |
224 | 224 | $endpoint = '/users/'.$username.'/roster/'.$jid; |
225 | - return $this->doRequest('PUT', $endpoint, $jid, compact('jid','username','subscriptionType')); |
|
225 | + return $this->doRequest('PUT', $endpoint, $jid, compact('jid', 'username', 'subscriptionType')); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @param string $params Params |
256 | 256 | * @return json|false Json with data or error, or False when something went fully wrong |
257 | 257 | */ |
258 | - public function createChatRoom($params = []) |
|
258 | + public function createChatRoom($params = [ ]) |
|
259 | 259 | { |
260 | 260 | return $this->doRequest('POST', '/chatrooms', $params); |
261 | 261 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @param string $params Params |
268 | 268 | * @return json|false Json with data or error, or False when something went fully wrong |
269 | 269 | */ |
270 | - public function updateChatRoom($roomName, $params = []) |
|
270 | + public function updateChatRoom($roomName, $params = [ ]) |
|
271 | 271 | { |
272 | 272 | return $this->doRequest('PUT', '/chatrooms/'.$roomName, $params); |
273 | 273 | } |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | public function createGroup($name, $description = false) |
447 | 447 | { |
448 | 448 | $endpoint = '/groups/'; |
449 | - return $this->doRequest('POST', $endpoint, compact('name','description')); |
|
449 | + return $this->doRequest('POST', $endpoint, compact('name', 'description')); |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | /** |
@@ -468,10 +468,10 @@ discard block |
||
468 | 468 | * @param string $description Some description of the group |
469 | 469 | * |
470 | 470 | */ |
471 | - public function updateGroup($name, $description) |
|
471 | + public function updateGroup($name, $description) |
|
472 | 472 | { |
473 | 473 | $endpoint = '/groups/'.$name; |
474 | - return $this->doRequest('PUT', $endpoint, compact('name','description')); |
|
474 | + return $this->doRequest('PUT', $endpoint, compact('name', 'description')); |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | */ |
519 | 519 | public function broadcastMessage($message = '') |
520 | 520 | { |
521 | - $content =['body'=> $message]; |
|
521 | + $content = [ 'body'=> $message ]; |
|
522 | 522 | $endpoint = '/messages/users'; |
523 | 523 | return $this->doRequest('POST', $endpoint, $content); |
524 | 524 | } |