diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2568eb5f8b769..acf959b9a19fa 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4825,8 +4825,8 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF } elseif ($trunc == 'middle') { $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; if (dol_strlen($newstring, $stringencoding) > 2 && dol_strlen($newstring, $stringencoding) > ($size + 1)) { - $size1 = round($size / 2); - $size2 = round($size / 2); + $size1 = (int) round($size / 2); + $size2 = (int) round($size / 2); return dol_substr($newstring, 0, $size1, $stringencoding).'…'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding); } else { return $string; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a04c5ab4ba9ee..502b0961488bc 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -71,7 +71,7 @@ parameters: - '# SMTPs::(getFrom|getErrorsTo|getReplyTo)\(\) expects bool, string given.#' - '# getLocalTaxesFromRate expects int\|string#' - '#::(options)\(\) expects int\|string#' - - '# (print_barre_liste|dol_substr) expects int\|null#' + - '# print_barre_liste expects int\|null#' - '#(?:colorAdjustBrightness|imap_(?:(?:fetch)?body|fetchstructure)) expects int, string#' - '#(sendTicketMessageByEmail|addItemsFact|update_price|recur|addDepreciationLine|addline|generate|update|getSelectConditionsPaiements|select_state|listBoxes|literalBarcodeType)\(\) expects int, string#' - '#on array{url: mixed} in empty\(\) does not exist.#'