forked from Wavyzz/dolibarr
Qual: Fix PhanTypeMismatchArgumentNullable by updating PHPdoc of target function
# Qual: Fix PhanTypeMismatchArgumentNullable by updating PHPdoc of target function Reduce the number PhanTypeMismatchArgumentNullable by updating the phpdoc of the function that is called. Done when the called function allows null (empty check, or `if` test).
This commit is contained in:
@@ -3427,7 +3427,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false)
|
||||
* Output date in a string format according to outputlangs (or langs if not defined).
|
||||
* Return charset is always UTF-8, except if encodetoouput is defined. In this case charset is output charset
|
||||
*
|
||||
* @param int|string $time GM Timestamps date
|
||||
* @param null|int|string $time GM Timestamps date
|
||||
* @param string $format Output date format (tag of strftime function)
|
||||
* "%d %b %Y",
|
||||
* "%d/%m/%Y %H:%M",
|
||||
@@ -3449,7 +3449,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
global $conf, $langs;
|
||||
|
||||
// If date undefined or "", we return ""
|
||||
if (dol_strlen($time) == 0) {
|
||||
if (dol_strlen((string) $time) == 0) {
|
||||
return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)
|
||||
}
|
||||
|
||||
@@ -5788,7 +5788,7 @@ function img_error($titlealt = 'default')
|
||||
* Show next logo
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @return string Return img tag
|
||||
*/
|
||||
function img_next($titlealt = 'default', $moreatt = '')
|
||||
@@ -6264,16 +6264,16 @@ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages =
|
||||
/**
|
||||
* Show title line of an array
|
||||
*
|
||||
* @param string $name Label of field
|
||||
* @param ?string $name Label of field
|
||||
* @param string $file Url used when we click on sort picto
|
||||
* @param string $field Field to use for new sorting
|
||||
* @param string $begin ("" by default)
|
||||
* @param string $moreparam Add more parameters on sort url links ("" by default)
|
||||
* @param string $moreattrib Options of attribute td ("" by default)
|
||||
* @param string $sortfield Current field used to sort
|
||||
* @param string $sortorder Current sort order
|
||||
* @param ?string $sortfield Current field used to sort
|
||||
* @param ?string $sortorder Current sort order
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '.
|
||||
* @param string $tooltip Tooltip
|
||||
* @param ?string $tooltip Tooltip
|
||||
* @param int $forcenowrapcolumntitle No need for use 'wrapcolumntitle' css style
|
||||
* @return void
|
||||
*/
|
||||
@@ -6285,19 +6285,19 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m
|
||||
/**
|
||||
* Get title line of an array
|
||||
*
|
||||
* @param string $name Translation key of field to show or complete HTML string to show
|
||||
* @param int $thead 0=To use with standard table format, 1=To use inside <thead><tr>, 2=To use with <div>
|
||||
* @param string $file Url used when we click on sort picto
|
||||
* @param string $field Field to use for new sorting. Empty if this field is not sortable. Example "t.abc" or "t.abc,t.def"
|
||||
* @param string $begin ("" by default)
|
||||
* @param string $moreparam Add more parameters on sort url links ("" by default)
|
||||
* @param string $moreattrib Add more attributes on th ("" by default). To add more css class, use param $prefix.
|
||||
* @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id')
|
||||
* @param string $sortorder Current sort order (Ex: 'asc,desc')
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '.
|
||||
* @param int $disablesortlink 1=Disable sort link
|
||||
* @param string $tooltip Tooltip
|
||||
* @param int $forcenowrapcolumntitle No need for use 'wrapcolumntitle' css style
|
||||
* @param ?string $name Translation key of field to show or complete HTML string to show
|
||||
* @param int<0,2> $thead 0=To use with standard table format, 1=To use inside <thead><tr>, 2=To use with <div>
|
||||
* @param string $file Url used when we click on sort picto
|
||||
* @param string $field Field to use for new sorting. Empty if this field is not sortable. Example "t.abc" or "t.abc,t.def"
|
||||
* @param string $begin ("" by default)
|
||||
* @param string $moreparam Add more parameters on sort url links ("" by default)
|
||||
* @param string $moreattrib Add more attributes on th ("" by default). To add more css class, use param $prefix.
|
||||
* @param ?string $sortfield Current field used to sort (Ex: 'd.datep,d.id')
|
||||
* @param ?string $sortorder Current sort order (Ex: 'asc,desc')
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '.
|
||||
* @param int<0,1> $disablesortlink 1=Disable sort link
|
||||
* @param ?string $tooltip Tooltip
|
||||
* @param int<0,1> $forcenowrapcolumntitle No need to use 'wrapcolumntitle' css style
|
||||
* @return string
|
||||
*/
|
||||
function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin = "", $moreparam = "", $moreattrib = "", $sortfield = "", $sortorder = "", $prefix = "", $disablesortlink = 0, $tooltip = '', $forcenowrapcolumntitle = 0)
|
||||
@@ -6309,7 +6309,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
|
||||
$prefix .= 'right '; // For backward compatibility
|
||||
}
|
||||
|
||||
$sortorder = strtoupper($sortorder);
|
||||
$sortorder = strtoupper((string) $sortorder);
|
||||
$out = '';
|
||||
$sortimg = '';
|
||||
|
||||
@@ -6318,7 +6318,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
|
||||
$tag = 'div';
|
||||
}
|
||||
|
||||
$tmpsortfield = explode(',', $sortfield);
|
||||
$tmpsortfield = explode(',', (string) $sortfield);
|
||||
$sortfield1 = trim($tmpsortfield[0]); // If $sortfield is 'd.datep,d.id', it becomes 'd.datep'
|
||||
$tmpfield = explode(',', $field);
|
||||
$field1 = trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep'
|
||||
@@ -6496,8 +6496,8 @@ function load_fiche_titre($title, $morehtmlright = '', $picto = 'generic', $pict
|
||||
* @param int|null $page Numero of page to show in navigation links (required)
|
||||
* @param string $file Url of page (required)
|
||||
* @param string $options More parameters for links ('' by default, does not include sortfield neither sortorder). Value must be 'urlencoded' before calling function.
|
||||
* @param string $sortfield Field to sort on ('' by default)
|
||||
* @param string $sortorder Order to sort ('' by default)
|
||||
* @param ?string $sortfield Field to sort on ('' by default)
|
||||
* @param ?string $sortorder Order to sort ('' by default)
|
||||
* @param string $morehtmlcenter String in the middle ('' by default). We often find here string $massaction coming from $form->selectMassAction()
|
||||
* @param int $num Number of records found by select with limit+1
|
||||
* @param int|string $totalnboflines Total number of records/lines for all pages (if known). Use a negative value of number to not show number. Use '' if unknown.
|
||||
@@ -7148,8 +7148,8 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
|
||||
*
|
||||
* @param float|string $vatrate Vat rate. Can be '8.5' or '8.5 (VATCODEX)' for example
|
||||
* @param int $local Local tax to search and return (1 or 2 return only tax rate 1 or tax rate 2)
|
||||
* @param Societe $thirdparty_buyer Object of buying third party
|
||||
* @param Societe $thirdparty_seller Object of selling third party ($mysoc if not defined)
|
||||
* @param ?Societe $thirdparty_buyer Object of buying third party
|
||||
* @param ?Societe $thirdparty_seller Object of selling third party ($mysoc if not defined)
|
||||
* @param int $vatnpr If vat rate is NPR or not
|
||||
* @return int<0,0>|string 0 if not found, localtax rate if found (Can be '20', '-19:-15:-9')
|
||||
* @see get_default_tva()
|
||||
@@ -7417,8 +7417,8 @@ function getTaxesFromId($vatrate, $buyer = null, $seller = null, $firstparamisid
|
||||
*
|
||||
* @param int|string $vatrate VAT ID or Rate+Code. Value can be value or the string with code into parenthesis or rowid if $firstparamisid is 1. Example: '8.5' or '8.5 (8.5NPR)' or 123.
|
||||
* @param int<0,2> $local Number of localtax (1 or 2, or 0 to return 1 & 2)
|
||||
* @param Societe $buyer Company object
|
||||
* @param Societe $seller Company object
|
||||
* @param ?Societe $buyer Company object
|
||||
* @param ?Societe $seller Company object
|
||||
* @param int<0,1> $firstparamisid 1 if first param is ID into table instead of Rate+code (use this if you can)
|
||||
* @return array{}|array{0:string,1:int|string,2:string,3:string}|array{0:string,1:int|string,2:string,3:int|string,4:string,5:string} array(localtax_type1('1-6' or '0' if not found), rate localtax1, localtax_type2, rate localtax2, accountancycodecust, accountancycodesupp)
|
||||
* @see getTaxesFromId()
|
||||
|
||||
Reference in New Issue
Block a user