Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"issues": "https://github.com/gidkom/php-openfire-restapi/issues"
},
"require": {
"php": "^7.2.5",
"php": "^7.2.5 || ^8.0",
"ext-curl": "*",
"guzzlehttp/guzzle": "^7.0"
},
Expand Down
14 changes: 7 additions & 7 deletions src/Gidkom/OpenFireRestApi/OpenFireRestApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getUser($username)
* @param string|false $email Email (Optional)
* @return json|false Json with data or error, or False when something went fully wrong
*/
public function addUser($username, $password, $name=false, $email=false)
public function addUser($username, $password, $name=null, $email=null)
{
$endpoint = '/users';
return $this->doRequest('POST', $endpoint, compact('username', 'password','name','email'));
Expand Down Expand Up @@ -82,10 +82,10 @@ public function deleteUser($username)
* @param string[]|false $groups Groups (Optional)
* @return json|false Json with data or error, or False when something went fully wrong
*/
public function updateUser($username, $password, $name=false, $email=false, $groups=false)
public function updateUser($username, $password, $name=null, $email=null)
{
$endpoint = '/users/'.$username;
return $this->doRequest('PUT', $endpoint, compact('username', 'password','name','email', 'groups'));
return $this->doRequest('PUT', $endpoint, compact('username', 'password','name','email'));
}


Expand Down Expand Up @@ -190,10 +190,10 @@ public function userRosters($username)
* @param int|false $subscriptionType Subscription (Optional)
* @return json|false Json with data or error, or False when something went fully wrong
*/
public function addToRoster($username, $jid, $name=false, $subscriptionType=false)
public function addToRoster($username, $jid, $nickname=null, $subscriptionType=null)
{
$endpoint = '/users/'.$username.'/roster';
return $this->doRequest('POST', $endpoint, compact('jid','name','subscriptionType'));
return $this->doRequest('POST', $endpoint, compact('jid','nickname','subscriptionType'));
}


Expand All @@ -219,10 +219,10 @@ public function deleteFromRoster($username, $jid)
* @param int|false $subscriptionType Subscription (Optional)
* @return json|false Json with data or error, or False when something went fully wrong
*/
public function updateRoster($username, $jid, $nickname=false, $subscriptionType=false)
public function updateRoster($username, $jid, $nickname=null, $subscriptionType=null)
{
$endpoint = '/users/'.$username.'/roster/'.$jid;
return $this->doRequest('PUT', $endpoint, $jid, compact('jid','username','subscriptionType'));
return $this->doRequest('PUT', $endpoint, compact('jid', 'subscriptionType', 'nickname'));
}


Expand Down