2
0
forked from Wavyzz/dolibarr

avoid phpstan error with phpdoc

This commit is contained in:
Frédéric FRANCE
2023-12-06 15:46:39 +01:00
parent 20d3fe4a78
commit 61b79fda17
181 changed files with 573 additions and 573 deletions

View File

@@ -164,7 +164,7 @@ function versiondolibarrarray()
* @param int $colspan 2=Add a colspan=2 on td
* @param int $onlysqltoimportwebsite Only sql resquests used to import a website template are allowed
* @param string $database Database (replace __DATABASE__ with this value)
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
*/
function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0, $onlysqltoimportwebsite = 0, $database = '')
{

View File

@@ -550,7 +550,7 @@ function dol_dir_is_emtpy($folder)
* Count number of lines in a file
*
* @param string $file Filename
* @return int <0 if KO, Number of lines in files if OK
* @return int Return integer <0 if KO, Number of lines in files if OK
* @see dol_nboflines()
*/
function dol_count_nb_of_line($file)
@@ -623,7 +623,7 @@ function dol_fileperm($pathoffile)
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
* @param int $indexdatabase 1=index new file into database.
* @param int $arrayreplacementisregex 1=Array of replacement is regex
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @return int Return integer <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @see dol_copy()
*/
function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0, $arrayreplacementisregex = 0)
@@ -711,7 +711,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @param int $testvirus Do an antivirus test. Move is canceled if a virus is found.
* @param int $indexdatabase Index new file into database.
* @return int <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK
* @return int Return integer <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK
* @see dol_delete_file() dolCopyDir()
*/
function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $testvirus = 0, $indexdatabase = 0)
@@ -839,7 +839,7 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
* @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
* @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories).
* @param array $excludefileext Exclude some file extensions
* @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
* @return int Return integer <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
* @see dol_copy()
*/
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null, $excludesubdir = 0, $excludefileext = null)
@@ -1755,7 +1755,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
* @param int $generatethumbs 1=Generate also thumbs for uploaded image files
* @param Object $object Object used to set 'src_object_*' fields
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
* @see dol_remove_file_process()
*/
function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null)
@@ -1991,7 +1991,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @param int $setsharekey Set also the share key
* @param Object $object Object used to set 'src_object_*' fields
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0, $object = null)
{
@@ -2056,7 +2056,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
* @param string $dir Directory name (full real path without ending /)
* @param string $file File name
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
{
@@ -2114,7 +2114,7 @@ function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
* @param string $fileoutput Output filename
* @param string $page Page number if we convert a PDF into png
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
* @see dol_imageResizeOrCrop()
*/
function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '')

View File

@@ -6753,7 +6753,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
* @param int $idprod Id of product
* @param int $local 1 for localtax1, 2 for localtax 2
* @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...)
* @return int <0 if KO, Vat rate if OK
* @return int Return integer <0 if KO, Vat rate if OK
* @see get_product_vat_for_country()
*/
function get_product_localtax_for_country($idprod, $local, $thirdpartytouse)
@@ -7138,7 +7138,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
* @param string $dataroot Data root directory (To avoid having the data root in the loop. Using this will also lost the warning, on first dir, saying PHP has no permission when open_basedir is used)
* @param string $newmask Mask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
* @return int < 0 if KO, 0 = already exists, > 0 if OK
* @return int Return integer < 0 if KO, 0 = already exists, > 0 if OK
*/
function dol_mkdir($dir, $dataroot = '', $newmask = '')
{
@@ -9441,7 +9441,7 @@ function dol_osencode($str)
* @param string $fieldid Field to get
* @param int $entityfilter Filter by entity
* @param string $filters Filters to add. WARNING: string must be escaped for SQL and not coming from user input.
* @return int <0 if KO, Id of code if OK
* @return int Return integer <0 if KO, Id of code if OK
* @see $langs->getLabelFromKey
*/
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '')

View File

@@ -1503,7 +1503,7 @@ function get_string_between($string, $start, $end)
*
* @param string $mask Mask to use
* @param string $value Value
* @return int|string <0 or error string if KO, 0 if OK
* @return int|string Return integer <0 or error string if KO, 0 if OK
*/
function check_value($mask, $value)
{

View File

@@ -62,7 +62,7 @@ $shmoffset = 1000; // Max number of entries found into a language file. If too l
* @param string $memoryid Memory id of shared area
* @param mixed $data Data to save. It must not be a null value.
* @param int $expire ttl in seconds, 0 never expire
* @return int <0 if KO, 0 if nothing is done, Nb of bytes written if OK
* @return int Return integer <0 if KO, 0 if nothing is done, Nb of bytes written if OK
* @see dol_getcache()
*/
function dol_setcache($memoryid, $data, $expire = 0)
@@ -134,7 +134,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area
* @return int|mixed <0 if KO, data if OK, null if not found into cache or no caching feature enabled
* @return int|mixed Return integer <0 if KO, data if OK, null if not found into cache or no caching feature enabled
* @see dol_setcache()
*/
function dol_getcache($memoryid)
@@ -214,7 +214,7 @@ function dol_getcache($memoryid)
* Return shared memory address used to store dataset with key memoryid
*
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
* @return int <0 if KO, Memoy address of shared memory for key
* @return int Return integer <0 if KO, Memoy address of shared memory for key
*/
function dol_getshmopaddress($memoryid)
{
@@ -250,7 +250,7 @@ function dol_listshmop()
* @param int $memoryid Memory id of shared area ('main', 'agenda', ...)
* @param string $data Data to save. Must be a not null value.
* @param int $expire ttl in seconds, 0 never expire
* @return int <0 if KO, 0=Caching not available, Nb of bytes written if OK
* @return int Return integer <0 if KO, 0=Caching not available, Nb of bytes written if OK
*/
function dol_setshmop($memoryid, $data, $expire)
{
@@ -287,7 +287,7 @@ function dol_setshmop($memoryid, $data, $expire)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
* @return int <0 if KO, data if OK, Null if no cache enabled or not found
* @return int Return integer <0 if KO, data if OK, Null if no cache enabled or not found
*/
function dol_getshmop($memoryid)
{

View File

@@ -32,7 +32,7 @@
* @param string $readdir Directory source (use $destdir when not defined)
* @param string $addfieldentry Array of 1 field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure')
* @param string $delfieldentry Id of field to remove
* @return int|object <=0 if KO, Object if OK
* @return int|object Return integer <=0 if KO, Object if OK
* @see rebuildObjectSql()
*/
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = '', $addfieldentry = array(), $delfieldentry = '')
@@ -250,7 +250,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
* @param string $readdir Directory source (use $destdir when not defined)
* @param Object $object If object was already loaded/known, it is pass to avoid another include and new.
* @param string $moduletype 'external' or 'internal'
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
* @see rebuildObjectClass()
*/
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null, $moduletype = 'external')
@@ -429,7 +429,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
* Get list of existing objects from directory
*
* @param string $destdir Directory
* @return array|int <=0 if KO, array if OK
* @return array|int Return integer <=0 if KO, array if OK
*/
function dolGetListOfObjectClasses($destdir)
{

View File

@@ -30,7 +30,7 @@
* @param string $desc Description of export
* @param array $events_array Array of events ("uid","startdate","duration","enddate","title","summary","category","email","url","desc","author")
* @param string $outputfile Output file
* @return int < 0 if KO, Nb of events in file if OK
* @return int Return integer < 0 if KO, Nb of events in file if OK
*/
function build_calfile($format, $title, $desc, $events_array, $outputfile)
{
@@ -320,7 +320,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
* @param string $filter (optional) Filter
* @param string $url Url (If empty, forge URL for agenda RSS export)
* @param string $langcode Language code to show in header
* @return int < 0 if KO, Nb of events in file if OK
* @return int Return integer < 0 if KO, Nb of events in file if OK
*/
function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filter = '', $url = '', $langcode = '')
{