Fix qodana

This commit is contained in:
Laurent Destailleur 2023-01-04 18:34:54 +01:00
parent 0a07ab199b
commit 27792fe1ad
12 changed files with 34 additions and 33 deletions

View File

@ -108,11 +108,11 @@ class Orders extends DolibarrApi
*
* Return an array with order informations
*
* @param int $id ID of order
* @param int $id ID of order
* @param string $ref Ref of object
* @param string $ref_ext External reference of object
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
* @return array|mixed data without useless information
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
* @return Object Object with cleaned properties
*
* @throws RestException
*/

View File

@ -122,8 +122,8 @@ class BankAccounts extends DolibarrApi
/**
* Get account by ID.
*
* @param int $id ID of account
* @return array Account object
* @param int $id ID of account
* @return Object Object with cleaned properties
*
* @throws RestException
*/
@ -313,9 +313,9 @@ class BankAccounts extends DolibarrApi
/**
* Update account
*
* @param int $id ID of account
* @param array $request_data data
* @return int
* @param int $id ID of account
* @param array $request_data data
* @return Object Object with cleaned properties
*/
public function put($id, $request_data = null)
{

View File

@ -351,16 +351,18 @@ class Comment extends CommonObject
/**
* Load comments linked with current task
* Load comments linked with current task into ->comments
*
* @param string $element_type Element type
* @param int $fk_element Id of element
* @return array Comment array
* @return int Result
*/
public function fetchAllFor($element_type, $fk_element)
{
global $db, $conf;
$this->comments = array();
if (!empty($element_type) && !empty($fk_element)) {
$sql = "SELECT";
$sql .= " c.rowid";

View File

@ -198,9 +198,9 @@ class EvalMath
}
/**
* vars
* Function vars
*
* @return string Output
* @return array Output
*/
public function vars()
{
@ -211,9 +211,9 @@ class EvalMath
}
/**
* vars
* Function funcs
*
* @return string Output
* @return array Output
*/
private function funcs()
{
@ -229,8 +229,8 @@ class EvalMath
/**
* Convert infix to postfix notation
*
* @param string $expr Expression
* @return string Output
* @param string $expr Expression
* @return boolean|array Output
*/
private function nfx($expr)
{
@ -367,6 +367,7 @@ class EvalMath
}
$output[] = $op;
}
return $output;
}

View File

@ -779,7 +779,7 @@ class FormTicket
* @param string $morecss More CSS
* @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes.
* @param Translate $outputlangs Output language
* @return void
* @return string|void String of HTML component
*/
public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null)
{
@ -985,7 +985,6 @@ class FormTicket
}
$sql = substr($sql, 0, -2);
$sql .= ")";
} else {
}
$sql .= $this->db->order('ctc.pos', 'ASC');

View File

@ -178,7 +178,7 @@ class SimpleOpenID
/**
* SetOpenIDServer
*
* @return void
* @return array
*/
public function GetError()
{
@ -225,7 +225,7 @@ class SimpleOpenID
* splitResponse
*
* @param string $response Server
* @return void
* @return array
*/
public function splitResponse($response)
{

View File

@ -907,7 +907,7 @@ class pdf_azur extends ModelePDFPropales
* @param Propal $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
* @return void
* @return int
*/
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{

View File

@ -744,7 +744,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
* @param Object $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
* @return void
* @return int
*/
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{

View File

@ -29,7 +29,6 @@
*/
class Projects extends DolibarrApi
{
/**
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
@ -267,10 +266,9 @@ class Projects extends DolibarrApi
*
* @param int $id Id of project
* @param int $userid Id of user (0 = connected user)
* @return array
*
* @url GET {id}/roles
*
* @return int
*/
public function getRoles($id, $userid = 0)
{
@ -301,6 +299,7 @@ class Projects extends DolibarrApi
foreach ($this->project->roles as $line) {
array_push($result, $this->_cleanObjectDatas($line));
}
return $result;
}

View File

@ -1480,7 +1480,7 @@ class Project extends CommonObject
* @param int $list 0=Return array, 1=Return string list
* @param int $socid 0=No filter on third party, id of third party
* @param string $filter additionnal filter on project (statut, ref, ...)
* @return array or string Array of projects id, or string with projects id separated with "," if list is 1
* @return array|string Array of projects id, or string with projects id separated with "," if list is 1
*/
public function getProjectsAuthorizedForUser($user, $mode = 0, $list = 0, $socid = 0, $filter = '')
{

View File

@ -3489,7 +3489,7 @@ class User extends CommonObject
*
* @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree.
* @param string $filter SQL filter on users. This parameter must not come from user intput.
* @return array Array of users $this->users. Note: $this->parentof is also set.
* @return array|int Array of users $this->users. Note: $this->parentof is also set.
*/
public function get_full_tree($deleteafterid = 0, $filter = '')
{

View File

@ -180,9 +180,9 @@ class UserGroup extends CommonObject
/**
* Return array of groups objects for a particular user
*
* @param int $userid User id to search
* @param boolean $load_members Load all members of the group
* @return array Array of groups objects
* @param int $userid User id to search
* @param boolean $load_members Load all members of the group
* @return array|int Array of groups objects
*/
public function listGroupsForUser($userid, $load_members = true)
{
@ -544,7 +544,7 @@ class UserGroup extends CommonObject
* Charge dans l'objet group, la liste des permissions auquels le groupe a droit
*
* @param string $moduletag Name of module we want permissions ('' means all)
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, >=0 if OK
*/
public function getrights($moduletag = '')
{
@ -552,12 +552,12 @@ class UserGroup extends CommonObject
if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag]) {
// Rights for this module are already loaded, so we leave
return;
return 0;
}
if (!empty($this->all_permissions_are_loaded)) {
// We already loaded all rights for this group, so we leave
return;
return 0;
}
/*