Merge pull request #23906 from FliyFly/qodanaincompatible

Fix (qodana)
This commit is contained in:
Laurent Destailleur 2023-03-08 13:21:14 +01:00 committed by GitHub
commit 3f264989ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 23 additions and 21 deletions

View File

@ -2088,7 +2088,7 @@ class BookKeeping extends CommonObject
* FIXME: This function takes the parent of parent to get the root account ! * FIXME: This function takes the parent of parent to get the root account !
* *
* @param string $account Accounting account * @param string $account Accounting account
* @return array Array with root account information (max 2 upper level) * @return array|int Array with root account information (max 2 upper level), <0 if KO
*/ */
public function getRootAccount($account = null) public function getRootAccount($account = null)
{ {

View File

@ -712,6 +712,7 @@ class Orders extends DolibarrApi
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 System error * @throws RestException 500 System error
*
*/ */
public function validate($id, $idwarehouse = 0, $notrigger = 0) public function validate($id, $idwarehouse = 0, $notrigger = 0)
{ {

View File

@ -2727,7 +2727,7 @@ class Commande extends CommonOrder
* @param int $offset For pagination * @param int $offset For pagination
* @param string $sortfield Sort criteria * @param string $sortfield Sort criteria
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @return int -1 if KO, array with result if OK * @return int|array -1 if KO, array with result if OK
*/ */
public function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC') public function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC')
{ {

View File

@ -1868,7 +1868,7 @@ class Contact extends CommonObject
* Updates all roles (default contact for companies) according to values inside the ->roles array. * Updates all roles (default contact for companies) according to values inside the ->roles array.
* This is called by update of contact. * This is called by update of contact.
* *
* @return float|int * @return int
* @see fetchRoles() * @see fetchRoles()
*/ */
public function updateRoles() public function updateRoles()
@ -1878,7 +1878,7 @@ class Contact extends CommonObject
$error = 0; $error = 0;
if (!isset($this->roles)) { if (!isset($this->roles)) {
return; // Avoid to loose roles when property not set return 0; // Avoid to loose roles when property not set
} }
$this->db->begin(); $this->db->begin();

View File

@ -758,7 +758,7 @@ class Contrat extends CommonObject
* *
* @param int $only_services 0=Default, 1=Force only services (depending on setup, we may also have physical products in a contract) * @param int $only_services 0=Default, 1=Force only services (depending on setup, we may also have physical products in a contract)
* @param int $loadalsotranslation 0=Default, 1=Load also translations of product descriptions * @param int $loadalsotranslation 0=Default, 1=Load also translations of product descriptions
* @return ContratLigne[] Return array of contract lines * @return array|int Return array of contract lines
*/ */
public function fetch_lines($only_services = 0, $loadalsotranslation = 0) public function fetch_lines($only_services = 0, $loadalsotranslation = 0)
{ {

View File

@ -62,7 +62,7 @@ class DolRequestDataCollector extends RequestDataCollector
/** /**
* Return widget settings * Return widget settings
* *
* @return void * @return array
*/ */
public function getWidgets() public function getWidgets()
{ {

View File

@ -2375,7 +2375,7 @@ class ExpenseReport extends CommonObject
* Return list of people with permission to validate expense reports. * Return list of people with permission to validate expense reports.
* Search for permission "approve expense report" * Search for permission "approve expense report"
* *
* @return array Array of user ids * @return array|int Array of user ids, <0 if KO
*/ */
public function fetch_users_approver_expensereport() public function fetch_users_approver_expensereport()
{ {

View File

@ -4227,7 +4227,7 @@ function migrate_delete_old_dir($db, $langs, $conf)
function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $force = 0) function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $force = 0)
{ {
if (count($listofmodule) == 0) { if (count($listofmodule) == 0) {
return; return 0;
} }
dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force.", listofmodule=".join(',', array_keys($listofmodule))); dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force.", listofmodule=".join(',', array_keys($listofmodule)));

View File

@ -882,7 +882,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis * @param Translate $outputlangsbis Object lang for output bis
* @return void * @return float|int
*/ */
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{ {

View File

@ -431,7 +431,7 @@ class Productbatch extends CommonObject
* @param int $fk_product_stock id product_stock for objet * @param int $fk_product_stock id product_stock for objet
* @param int $with_qty 1 = doesn't return line with 0 quantity * @param int $with_qty 1 = doesn't return line with 0 quantity
* @param int $fk_product If set to a product id, get eatby and sellby from table llx_product_lot * @param int $fk_product If set to a product id, get eatby and sellby from table llx_product_lot
* @return array <0 if KO, array of batch * @return array|int <0 if KO, array of batch
*/ */
public static function findAll($dbs, $fk_product_stock, $with_qty = 0, $fk_product = 0) public static function findAll($dbs, $fk_product_stock, $with_qty = 0, $fk_product = 0)
{ {

View File

@ -162,7 +162,7 @@ class PriceExpression
/** /**
* List all price expressions * List all price expressions
* *
* @return array Array of price expressions * @return array|int Array of price expressions, <0 if ko
*/ */
public function list_price_expression() public function list_price_expression()
{ {

View File

@ -311,7 +311,7 @@ class PriceGlobalVariable
/** /**
* List all price global variables * List all price global variables
* *
* @return array Array of price global variables * @return array|int Array of price global variables, <0 if ko
*/ */
public function listGlobalVariables() public function listGlobalVariables()
{ {

View File

@ -242,7 +242,7 @@ class ProductStockEntrepot extends CommonObject
* @param array $filter filter array * @param array $filter filter array
* @param string $filtermode filter mode (AND or OR) * @param string $filtermode filter mode (AND or OR)
* *
* @return int <0 if KO, >0 if OK * @return int|array <0 if KO, array if OK
*/ */
public function fetchAll($fk_product = '', $fk_entrepot = '', $sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') public function fetchAll($fk_product = '', $fk_entrepot = '', $sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{ {

View File

@ -271,6 +271,7 @@ class Tasks extends DolibarrApi
* @return array Array of roles * @return array Array of roles
* *
* @url GET {id}/roles * @url GET {id}/roles
*
*/ */
public function getRoles($id, $userid = 0) public function getRoles($id, $userid = 0)
{ {

View File

@ -801,7 +801,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis * @param Translate $outputlangsbis Object lang for output bis
* @return void * @return float|int
*/ */
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{ {

View File

@ -77,7 +77,7 @@ class FormResource
* @param int $limit Limit number of answers * @param int $limit Limit number of answers
* @param string $morecss More css * @param string $morecss More css
* @param bool $multiple add [] in the name of element and add 'multiple' attribut * @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @return string HTML string with * @return string|array HTML string with
*/ */
public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false) public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false)
{ {

View File

@ -2883,7 +2883,7 @@ class Ticket extends CommonObject
* *
* @param User $user Object user * @param User $user Object user
* @param int $mode "opened" for askprice to close, "signed" for proposal to invoice * @param int $mode "opened" for askprice to close, "signed" for proposal to invoice
* @return int <0 if KO, >0 if OK * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/ */
public function load_board($user, $mode) public function load_board($user, $mode)
{ {

View File

@ -654,7 +654,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty)
* *
* @param array $authentication Array of authentication information * @param array $authentication Array of authentication information
* @param array $order Order info * @param array $order Order info
* @return int Id of new order * @return array array of new order
*/ */
function createOrder($authentication, $order) function createOrder($authentication, $order)
{ {

View File

@ -185,7 +185,7 @@ function getVersions($authentication)
* @param string $modulepart Properties of document * @param string $modulepart Properties of document
* @param string $file Relative path * @param string $file Relative path
* @param string $refname Ref of object to check permission for external users (autodetect if not provided) * @param string $refname Ref of object to check permission for external users (autodetect if not provided)
* @return void * @return array
*/ */
function getDocument($authentication, $modulepart, $file, $refname = '') function getDocument($authentication, $modulepart, $file, $refname = '')
{ {

View File

@ -235,7 +235,7 @@ $server->register(
* *
* @param array $authentication Array of authentication information * @param array $authentication Array of authentication information
* @param array $project Project info * @param array $project Project info
* @return int Id of new order * @return array array of new order
*/ */
function createProject($authentication, $project) function createProject($authentication, $project)
{ {

View File

@ -239,7 +239,7 @@ class Zapier extends DolibarrApi
* Create hook object * Create hook object
* *
* @param array $request_data Request datas * @param array $request_data Request datas
* @return int ID of hook * @return array ID of hook
* *
* @url POST /hook/ * @url POST /hook/
*/ */