diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 362728c367bc0..fe307fe8915f7 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1231,7 +1231,7 @@ public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $o } elseif ($key == 't.reconciled_option') { $sqlwhere[] = 't.lettering_code IS NULL'; } else { - $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->escape($this->db->escapeforlike($value))."%'"; + $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'"; } } } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 91f76b66cdd40..81fe78a073ccc 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -628,19 +628,19 @@ function(response) { /** * On/off button for constant * - * @param string $code Name of constant - * @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid')) - * @param int $entity Entity. Current entity is used if null. - * @param int $revertonoff 1=Revert on/off - * @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant - * @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input) - * @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin. - * @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code. - * @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it - * @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red' - * @param string $mode Add parameter &mode= to the href link (Used for href link) - * @param string $morecss More CSS - * @return string + * @param string $code Name of constant + * @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid')) + * @param int|null $entity Entity. Current entity is used if null. + * @param int $revertonoff 1=Revert on/off + * @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant + * @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input) + * @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin. + * @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code. + * @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it + * @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red' + * @param string $mode Add parameter &mode= to the href link (Used for href link) + * @param string $morecss More CSS + * @return string */ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block') { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8dac59762894f..30f5dc3b5b416 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6890,7 +6890,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric if (($mysoc->country_code == $thirdpartytouse->country_code) || (in_array($mysoc->country_code, array('FR', 'MC')) && in_array($thirdpartytouse->country_code, array('FR', 'MC'))) || (in_array($mysoc->country_code, array('MQ', 'GP')) && in_array($thirdpartytouse->country_code, array('MQ', 'GP'))) - ) { + ) { // If country of thirdparty to consider is ours if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object $result = $product->get_buyprice($idprodfournprice, 0, 0, 0); @@ -9756,13 +9756,13 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = } /** - * Check if a variable with name $var start with $text. + * Check if a variable with name $var startx with $text. * Can be used to forge dol_eval() conditions. * - * @param $var string Variable - * @param $regextext string Text that must be a valid regex string - * @param $matchrule int 1=Test if start with, 0=Test if equal - * @return boolean|string True or False, text if bad use. + * @param string $var Variable + * @param string $regextext Text that must be a valid regex string + * @param int $matchrule 1=Test if start with, 0=Test if equal + * @return boolean|string True or False, text if bad usage. */ function isStringVarMatching($var, $regextext, $matchrule = 1) { @@ -13078,6 +13078,8 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n } $histo = array(); + '@phan-var-force array $histo'; + $numaction = 0; $now = dol_now(); @@ -13157,7 +13159,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n } $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; - if ($force_filter_contact === false) { + if (!$force_filter_contact) { if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) { $sql .= " AND a.fk_soc = ".((int) $filterobj->id); } elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) { @@ -13285,6 +13287,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + '@phan-var-force array{apicto:string,contact_id:string,dp:string,dp2:string,firstname:string,label:string,message:string,msg_from:string,ref:string,type:string,user_lastname:string} $obj'; if ($obj->type == 'action') { $contactaction = new ActionComm($db); $contactaction->id = $obj->id; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4cfac0f441341..7d342e152a36c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -429,7 +429,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali * @param Contact|string|null $targetcontact Target contact object * @param int $usecontact Use contact instead of company * @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url) - * @param Object $object Object we want to build document for + * @param Object|null $object Object we want to build document for * @return string|int String with full address or -1 if KO */ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null) @@ -718,7 +718,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t /** * Show header of page for PDF generation * - * @param TCPDF $pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Translate $outputlangs Object lang for output * @param int $page_height Height of page * @return void @@ -752,11 +752,11 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height) /** * Return array of possible substitutions for PDF content (without external module substitutions). * - * @param Translate $outputlangs Output language - * @param array $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...) - * @param Object $object Object - * @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip) - * @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) + * @param Translate $outputlangs Output language + * @param array|null $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...) + * @param Object|null $object Object + * @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip) + * @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) * @return array Array of substitutions */ function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0, $include = null) @@ -2296,11 +2296,11 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0) /** * Return line percent * - * @param Object $object Object - * @param int $i Current line number - * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @param HookManager $hookmanager Hook manager instance + * @param Object $object Object + * @param int $i Current line number + * @param Translate $outputlangs Object langs for output + * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param HookManager|null $hookmanager Hook manager instance * @return string */ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f0e85472b8021..4fdefef202b61 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2763,7 +2763,7 @@ // Presend form $modelmail = 'shipping_send'; - $defaulttopic = $langs->trans('SendShippingRef'); + $defaulttopic = 'SendShippingRef'; $diroutput = $conf->expedition->dir_output.'/sending'; $trackid = 'shi'.$object->id; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 684bc39b3c3dd..dbed9cad90291 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -365,7 +365,7 @@ public function fetchLines() * @param string $filtermode No more used * @return array|int int <0 if KO, array of pages if OK */ - public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 3eb5b1bdc4518..20f51e90e78cf 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -108,7 +108,7 @@ class Loan extends CommonObject public $fk_project; /** - * @var int totalpaid + * @var float totalpaid */ public $totalpaid; diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 1908a2a0b4b38..e29e1a08911ff 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -64,7 +64,7 @@ public function __construct() * @param int $id ID of myobject * @return Object Object with cleaned properties * - * @url GET myobjects/{id} + * @url GET mymodule/myobjects/{id} * * @throws RestException 403 Not allowed * @throws RestException 404 Not found @@ -103,7 +103,7 @@ public function get($id) * @throws RestException 403 Not allowed * @throws RestException 503 System error * - * @url GET /myobjects/ + * @url GET /mymodule/myobjects/ */ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '') { @@ -191,7 +191,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, * @throws RestException 403 Not allowed * @throws RestException 500 System error * - * @url POST myobjects/ + * @url POST mymodule/myobjects/ */ public function post($request_data = null) { @@ -232,7 +232,7 @@ public function post($request_data = null) * @throws RestException 404 Not found * @throws RestException 500 System error * - * @url PUT myobjects/{id} + * @url PUT mymodule/myobjects/{id} */ public function put($id, $request_data = null) { @@ -282,7 +282,7 @@ public function put($id, $request_data = null) * @throws RestException 409 Nothing to do * @throws RestException 500 System error * - * @url DELETE myobjects/{id} + * @url DELETE mymodule/myobjects/{id} */ public function delete($id) {