2
0
forked from Wavyzz/dolibarr

Clean code

This commit is contained in:
Laurent Destailleur
2020-12-24 02:33:11 +01:00
parent e9129154e4
commit 11a122176d
3 changed files with 11 additions and 12 deletions

View File

@@ -173,7 +173,7 @@ class DolibarrApi
unset($object->name_bis); unset($object->name_bis);
unset($object->newref); unset($object->newref);
if ($object->table_element != 'ticket') { if (!isset($object->table_element) || $object->table_element != 'ticket') {
unset($object->comments); unset($object->comments);
} }

View File

@@ -178,7 +178,7 @@ class Users extends DolibarrApi
* *
* @param string $login Login of user * @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) * @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 * @return array|mixed Data without useless information
* *
* @url GET login/{login} * @url GET login/{login}
* *
@@ -212,7 +212,7 @@ class Users extends DolibarrApi
* *
* @param string $email Email of user * @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) * @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 * @return array|mixed Data without useless information
* *
* @url GET email/{email} * @url GET email/{email}
* *

View File

@@ -190,7 +190,6 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
*/ */
public function testRestCreateUser() public function testRestCreateUser()
{ {
// attemp to create without mandatory fields : // attemp to create without mandatory fields :
$url = $this->api_url.'/users?api_key='.$this->api_key; $url = $this->api_url.'/users?api_key='.$this->api_key;
$addheaders=array('Content-Type: application/json'); $addheaders=array('Content-Type: application/json');