';
- print '';
+ print '| ';
print $langs->trans('PaymentConditionsShort');
print ' | ';
if ($action != 'editconditions' && $usercancreate && $caneditfield) {
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index e705ea36bc8..a7bd8a5b5c7 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4653,17 +4653,17 @@ class Form
* Return list of payment methods
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
*
- * @param string $selected Id or code or preselected payment mode
- * @param string $htmlname Name of select field
- * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
- * @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code
- * @param int $empty 1=can be empty, 0 otherwise
- * @param int $noadmininfo 0=Add admin info, 1=Disable admin info
- * @param int $maxlength Max length of label
- * @param int $active Active or not, -1 = all
- * @param string $morecss Add more CSS on select tag
- * @param int $nooutput 1=Return string, do not send to output
- * @return string|void String for the HTML select component
+ * @param string $selected Id or code or preselected payment mode
+ * @param string $htmlname Name of select field
+ * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
+ * @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code
+ * @param int $empty 1=can be empty, 0 otherwise
+ * @param int $noadmininfo 0=Add admin info, 1=Disable admin info
+ * @param int $maxlength Max length of label
+ * @param int $active Active or not, -1 = all
+ * @param string $morecss Add more CSS on select tag
+ * @param int<0,1> $nooutput 1=Return string, do not send to output
+ * @return string|void String for the HTML select component
*/
public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0)
{
@@ -5120,7 +5120,7 @@ class Form
* @param string $moreattrib To add more attribute on select
* @param int $showcurrency Show currency in label
* @param string $morecss More CSS
- * @param int $nooutput 1=Return string, do not send to output
+ * @param int<0,1> $nooutput 1=Return string, do not send to output
* @return int|string If noouput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string.
*/
public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '', $nooutput = 0)
@@ -5882,7 +5882,7 @@ class Form
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely except $selected,2=Disable)
* @param int $maxlength Max length
* @param int $forcefocus Force focus on field (works with javascript only)
- * @param int $nooutput No print is done. String is returned.
+ * @param int<0,1> $nooutput No print is done. String is returned.
* @param string $textifnoproject Text to show if no project
* @param string $morecss More CSS
* @return string Return html content
@@ -5940,7 +5940,7 @@ class Form
* @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
* 0 : use default deposit percentage from entry
* > 0 : force deposit percentage (for example, from company object)
- * @param int $nooutput No print is done. String is returned.
+ * @param int<0,1> $nooutput No print is done. String is returned.
* @return string HTML output or ''
*/
public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1, $nooutput = 0)
@@ -6065,7 +6065,7 @@ class Form
* @param string $htmlname Html name of date input fields or 'none'
* @param int $displayhour Display hour selector
* @param int $displaymin Display minutes selector
- * @param int $nooutput 1=No print output, return string
+ * @param int<0,1> $nooutput 1=No print output, return string
* @param string $type 'direct-debit' or 'bank-transfer'
* @return string
* @see selectDate()
@@ -6154,7 +6154,7 @@ class Form
* @param int $active Active or not, -1 = all
* @param int $addempty 1=Add empty entry
* @param string $type Type ('direct-debit' or 'bank-transfer')
- * @param int $nooutput 1=Return string, no output
+ * @param int<0,1> $nooutput 1=Return string, no output
* @return string HTML output or ''
*/
public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '', $nooutput = 0)
@@ -6446,7 +6446,7 @@ class Form
* @param int<0,1> $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int<0,1> $forcecombo Force to use combo box
* @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
- * @param int $nooutput No print output. Return it only.
+ * @param int<0,1> $nooutput No print output. Return it only.
* @param int[] $excludeids Exclude IDs from the select combo
* @param string $textifnothirdparty Text to show if no thirdparty
* @return string HTML output or ''
@@ -6948,7 +6948,7 @@ class Form
* @param string $form_name Not used
* @param int $d 1=Show days, month, years
* @param int $addnowlink Add a link "Now"
- * @param int $nooutput Do not output html string but return it
+ * @param int<0,1> $nooutput Do not output html string but return it
* @param int $disabled Disable input fields
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field.
@@ -7508,7 +7508,7 @@ class Form
* If 'text' input hour is in text and input min is a text,
* If 'textselect' input hour is in text and input min is a combo
* @param integer $minunderhours If 1, show minutes selection under the hours
- * @param int $nooutput Do not output html string but return it
+ * @param int<0,1> $nooutput Do not output html string but return it
* @return string HTML component
*/
public function select_duration($prefix, $iSecond = '', $disabled = 0, $typehour = 'select', $minunderhours = 0, $nooutput = 0)
@@ -9536,8 +9536,8 @@ class Form
* @param CommonObject $object Object we want to show links to
* @param string[] $restrictlinksto Restrict links to some elements, for example array('order') or array('supplier_order'). null or array() if no restriction.
* @param string[] $excludelinksto Do not show links of this type, for example array('order') or array('supplier_order'). null or array() if no exclusion.
- * @param int $nooutput 1=Return array with content instead of printing it.
- * @return string|array HTML block or array with htmlblock (depending on $nooutput value)
+ * @param int<0,1> $nooutput 1=Return array with content instead of printing it.
+ * @return array{linktoelem:string,htmltoenteralink:string}|string HTML block
*/
public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array(), $nooutput = 0)
{
@@ -9766,18 +9766,18 @@ class Form
if ($linktoelemlist) {
$linktoelem = '
-
- ';
+
+ ';
if (!empty($conf->use_javascript_ajax)) {
$linktoelem .= '- ' . $langs->trans("LinkTo") . '...
';
}
$linktoelem .= '-
-
- ' . $linktoelemlist . '
-
-
-
- ';
+
+ ' . $linktoelemlist . '
+
+
+
+ ';
} else {
$linktoelem = '';
}
@@ -9792,7 +9792,7 @@ class Form
});
});
- ';
+ ';
}
if ($nooutput) {
diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php
index a3ea72226a1..9b5c039372e 100644
--- a/htdocs/core/lib/ldap.lib.php
+++ b/htdocs/core/lib/ldap.lib.php
@@ -1,7 +1,8 @@
- * Copyright (C) 2006-2021 Regis Houssin
- * Copyright (C) 2024 MDW
+/* Copyright (C) 2006 Laurent Destailleur
+ * Copyright (C) 2006-2021 Regis Houssin
+ * Copyright (C) 2024 MDW
+ * Copyright (C) 2024 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -125,15 +126,13 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass)
* @param array<'count'|int|string,int|string|array> $result Array to show. This array is already encoded into charset_output
* @param int $level Level
* @param int $count Count
- * @param string $var Var
+ * @param bool $var Var deprecated (replaced by css oddeven)
* @param int<0,1> $hide Hide
* @param int $subcount Subcount
* @return int
*/
function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount = 0)
{
- global $bc, $conf;
-
$count--;
if ($count == 0) {
return -1; // To stop loop
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index 328c3490b6c..a1e2c984e58 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -274,7 +274,7 @@ print ' | '."\n";
print '';
print '| '.$langs->trans("ManageOpportunitiesStatus").' | ';
print '';
-print ajax_constantonoff("PROJECT_USE_OPPORTUNITIES", null, null, 0, 0, 1);
+print ajax_constantonoff("PROJECT_USE_OPPORTUNITIES", array(), null, 0, 0, 1);
print ' | ';
print " | ";
print ' ';
diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php
index a12272c94ab..3781788b03f 100644
--- a/htdocs/societe/project.php
+++ b/htdocs/societe/project.php
@@ -6,7 +6,7 @@
* Copyright (C) 2007 Patrick Raguin
* Copyright (C) 2010 Juanjo Menent
* Copyright (C) 2015 Marcos García
- * Copyright (C) 2021 Frédéric France
+ * Copyright (C) 2021-2024 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -176,7 +176,7 @@ if ($socid) {
print dol_get_fiche_end();
print ' ';
- $params = '';
+ $params = array();
$backtopage = $_SERVER['PHP_SELF'].'?socid='.$object->id;
$newcardbutton = dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopageforcancel='.urlencode($backtopage), '', 1, $params);
diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php
index 9c31175b1ab..c00d7a0d09c 100644
--- a/htdocs/stripe/admin/stripe.php
+++ b/htdocs/stripe/admin/stripe.php
@@ -593,7 +593,7 @@ print '';
print '| ';
print $langs->trans("SecurityTokenIsUnique").' | ';
if ($conf->use_javascript_ajax) {
- print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE', null, null, 0, 0, 1);
+ print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE', array(), null, 0, 0, 1);
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE);
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 4044a33546d..d985f2d1474 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -70,7 +70,7 @@ parameters:
- '#\$httpStatusCode of class Luracast\\Restler\\RestException constructor expects string, int given.#'
- '#(?:(?:s(?:(?:et_error_handl|pl_autoload_regist)er)|array_filter)) expects \(callable#'
- '# (dol_print_date|correctExifImageOrientation) expects bool\|string#'
- - '# (getRandomPassword|vatrate|DolEditor constructor) expects bool, int#'
+ - '# (vatrate|DolEditor constructor) expects bool, int#'
- '# SMTPs::(getFrom|getErrorsTo|getReplyTo)\(\) expects bool, string given.#'
- '# (dolibarr_set_const|getLocalTaxesFromRate) expects int\|string#'
- '#::(options)\(\) expects int\|string#'
@@ -94,15 +94,12 @@ parameters:
- '#::HTML2OpenIDServer\(\) expects string, array given.#'
- '#create_line\(\) expects string, float given.#'
- '# dol_stringtotime expects string, DateTime given.#'
- - '# show_ldap_content expects string, true given.#'
- '#expects string, bool\|mysqli_result\|resource given.#'
- '#( |::)((multi)?selectarray)\(\) expects array#'
- '# (reWriteAllMenus|check_authentication) expects array#'
- '#::(_validateMyObject|select_company)\(\) expects array |
|
|