Completed
Push — master ( 1f9abb...2de529 )
by Gideon
05:43
created
src/Gidkom/OpenFireRestApi/OpenFireRestApi.php 2 patches
Doc Comments   -8 removed lines patch added patch discarded remove patch
@@ -119,7 +119,6 @@  discard block
 block discarded – undo
119 119
      * Add user to a group
120 120
      *
121 121
      * @param   string          $username   Username
122
-     * @param   string           $groups   Groups to add user
123 122
      * @return  json|false                 Json with data or error, or False when something went fully wrong
124 123
      */
125 124
     public function addToGroup($username, $groupName)
@@ -133,7 +132,6 @@  discard block
 block discarded – undo
133 132
      * Delete user from a group
134 133
      *
135 134
      * @param   string          $username   Username
136
-     * @param   string           $groups   Groups to add user
137 135
      * @return  json|false                 Json with data or error, or False when something went fully wrong
138 136
      */
139 137
     public function deleteFromGroup($username, $groupName)
@@ -277,7 +275,6 @@  discard block
 block discarded – undo
277 275
     /**
278 276
      * Delete a chat room
279 277
      *
280
-     * @param   string      $name               Name of the Group to delete
281 278
      * @return  json|false                       Json with data or error, or False when something went fully wrong
282 279
      */
283 280
     public function deleteChatRoom($roomName)
@@ -288,7 +285,6 @@  discard block
 block discarded – undo
288 285
     /**
289 286
      * Get chat room participants
290 287
      *
291
-     * @param   string      $name               Name of the chatroom
292 288
      * @return  json|false                       Json with data or error, or False when something went fully wrong
293 289
      */
294 290
     public function getChatRoomParticipants($roomName)      
@@ -299,7 +295,6 @@  discard block
 block discarded – undo
299 295
     /**
300 296
      * Get chat room occupants
301 297
      *
302
-     * @param   string      $name               Name of the chatroom
303 298
      * @return  json|false                       Json with data or error, or False when something went fully wrong
304 299
      */
305 300
     public function getChatRoomOccupants($roomName)      
@@ -356,7 +351,6 @@  discard block
 block discarded – undo
356 351
     /**
357 352
      * Retrieve a system property
358 353
      *
359
-     * @param   string      $name                Name of property
360 354
      * @return  json|false                       Json with data or error, or False when something went fully wrong
361 355
      */
362 356
     public function getSystemProperty($propertyName)
@@ -393,7 +387,6 @@  discard block
 block discarded – undo
393 387
     /**
394 388
      * Delete a system property
395 389
      *
396
-     * @param   array      $data                new property with value
397 390
      * @return  json|false                       Json with data or error, or False when something went fully wrong
398 391
      */
399 392
     public function deleteSystemProperty($propertyName)
@@ -514,7 +507,6 @@  discard block
 block discarded – undo
514 507
     /**
515 508
      * Send a broadcast message to all online users
516 509
      *
517
-     * @param  string      $content               message to send
518 510
      * @return json|false       Json with data or error, or False when something went fully wrong
519 511
      */
520 512
     public function broadcastMessage($message = '')
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
         
28 28
         if(isset($opts['search'])) $query .= '?search='.$opts['search'];
29 29
         
30
-    	$endpoint = '/users'.$query;        
31
-    	return $this->doRequest('GET', $endpoint);
30
+        $endpoint = '/users'.$query;        
31
+        return $this->doRequest('GET', $endpoint);
32 32
     }
33 33
 
34 34
 
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
     }
414 414
 
415 415
 
416
-     /**
417
-     * Get all groups
418
-     *
419
-     * @return  json|false      Json with data or error, or False when something went fully wrong
420
-     */
416
+        /**
417
+         * Get all groups
418
+         *
419
+         * @return  json|false      Json with data or error, or False when something went fully wrong
420
+         */
421 421
     public function getGroups()
422 422
     {
423 423
         $endpoint = '/groups';
Please login to merge, or discard this patch.
src/Gidkom/OpenFireRestApi/RestClient.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 */
9 9
 class RestClient
10 10
 {
11
-	public $host = 'localhost';
11
+    public $host = 'localhost';
12 12
     public $port = '9090';
13 13
     public $plugin = '/plugins/restapi/v1';
14 14
     public $secret = 'SuperSecret';
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
     public $basicUser = 'admin';
21 21
     public $basicPwd = '1234';
22 22
 
23
-	function __construct()
24
-	{
25
-		$this->client = new Client();
26
-	}
23
+    function __construct()
24
+    {
25
+        $this->client = new Client();
26
+    }
27 27
 
28 28
     /**
29 29
      * Make the request and analyze the result
@@ -33,28 +33,28 @@  discard block
 block discarded – undo
33 33
      * @param   array           $params         Parameters
34 34
      * @return  array|false                     Array with data or error, or False when something went fully wrong
35 35
      */
36
-	protected function doRequest($type, $endpoint, $params=[])
36
+    protected function doRequest($type, $endpoint, $params=[])
37 37
     {
38
-    	$base = ($this->useSSL) ? "https" : "http";
39
-    	$url = $base . "://" . $this->host . ":" .$this->port.$this->plugin.$endpoint;
38
+        $base = ($this->useSSL) ? "https" : "http";
39
+        $url = $base . "://" . $this->host . ":" .$this->port.$this->plugin.$endpoint;
40 40
 	    
41
-		if ($this->useBasicAuth)
41
+        if ($this->useBasicAuth)
42 42
             $auth = 'Basic ' . base64_encode($this->basicUser . ':' . $this->basicPwd);
43 43
         else
44 44
             $auth = $this->secret;
45 45
 	    
46
-    	$headers = array(
47
-  			'Accept' => 'application/json',
48
-  			'Authorization' => $auth,
46
+        $headers = array(
47
+                'Accept' => 'application/json',
48
+                'Authorization' => $auth,
49 49
             'Content-Type'=>'application/json'
50
-  		);
50
+            );
51 51
 
52 52
         $body = json_encode($params);
53 53
 
54 54
         try {
55
-        	$result = $this->client->request($type, $url, compact('headers','body'));
55
+            $result = $this->client->request($type, $url, compact('headers','body'));
56 56
         } catch (\Exception $e) {
57
-        	return  ['status'=>false, 'data'=>['message'=>$e->getMessage()]];
57
+            return  ['status'=>false, 'data'=>['message'=>$e->getMessage()]];
58 58
         }
59 59
 	        
60 60
         
Please login to merge, or discard this patch.