Clean code
This commit is contained in:
parent
e9129154e4
commit
11a122176d
@ -173,7 +173,7 @@ class DolibarrApi
|
||||
unset($object->name_bis);
|
||||
unset($object->newref);
|
||||
|
||||
if ($object->table_element != 'ticket') {
|
||||
if (!isset($object->table_element) || $object->table_element != 'ticket') {
|
||||
unset($object->comments);
|
||||
}
|
||||
|
||||
|
||||
@ -142,11 +142,11 @@ class Users extends DolibarrApi
|
||||
* Get properties of an user object
|
||||
*
|
||||
* @param int $id ID of user
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
*/
|
||||
public function get($id, $includepermissions = 0)
|
||||
{
|
||||
@ -177,13 +177,13 @@ class Users extends DolibarrApi
|
||||
* Get properties of an user object by login
|
||||
*
|
||||
* @param string $login Login of user
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @url GET login/{login}
|
||||
*
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
*/
|
||||
public function getByLogin($login, $includepermissions = 0)
|
||||
{
|
||||
@ -211,8 +211,8 @@ class Users extends DolibarrApi
|
||||
* Get properties of an user object by Email
|
||||
*
|
||||
* @param string $email Email of user
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @url GET email/{email}
|
||||
*
|
||||
|
||||
@ -190,7 +190,6 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
*/
|
||||
public function testRestCreateUser()
|
||||
{
|
||||
|
||||
// attemp to create without mandatory fields :
|
||||
$url = $this->api_url.'/users?api_key='.$this->api_key;
|
||||
$addheaders=array('Content-Type: application/json');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user