";
if (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT')) {
- print length_accounta($tabcompany[$key]['code_compta']);
+ print length_accounta($tabcompany[$key]['code_compta_fournisseur']);
}
} elseif (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '' . $langs->trans("ThirdpartyAccountNotDefined") . '';
diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php
index 27173334e7d..83fe00991f3 100644
--- a/htdocs/adherents/class/adherentstats.class.php
+++ b/htdocs/adherents/class/adherentstats.class.php
@@ -172,7 +172,7 @@ class AdherentStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array with nb, total amount, average for each year
+ * @return array Array with nb, total amount, average for each year
*/
public function getAllByYear()
{
diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php
index c98d314741d..360e6a868ff 100644
--- a/htdocs/bom/lib/bom.lib.php
+++ b/htdocs/bom/lib/bom.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2019-2023 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function bomAdminPrepareHead()
{
@@ -73,7 +74,7 @@ function bomAdminPrepareHead()
* Prepare array of tabs for BillOfMaterials
*
* @param BOM $object BillOfMaterials
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function bomPrepareHead($object)
{
diff --git a/htdocs/bookcal/lib/bookcal.lib.php b/htdocs/bookcal/lib/bookcal.lib.php
index 049de3c6472..8ce10a34009 100644
--- a/htdocs/bookcal/lib/bookcal.lib.php
+++ b/htdocs/bookcal/lib/bookcal.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function bookcalAdminPrepareHead()
{
diff --git a/htdocs/bookcal/lib/bookcal_availabilities.lib.php b/htdocs/bookcal/lib/bookcal_availabilities.lib.php
index a91e79cce52..558470345b6 100644
--- a/htdocs/bookcal/lib/bookcal_availabilities.lib.php
+++ b/htdocs/bookcal/lib/bookcal_availabilities.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
* Prepare array of tabs for Availabilities
*
* @param Availabilities $object Availabilities
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function availabilitiesPrepareHead($object)
{
diff --git a/htdocs/bookcal/lib/bookcal_calendar.lib.php b/htdocs/bookcal/lib/bookcal_calendar.lib.php
index 9a2bd1213e2..37cdcd18798 100644
--- a/htdocs/bookcal/lib/bookcal_calendar.lib.php
+++ b/htdocs/bookcal/lib/bookcal_calendar.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
* Prepare array of tabs for Calendar
*
* @param Calendar $object Calendar
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function calendarPrepareHead($object)
{
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index 77b347d2f41..649385d7d15 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -263,12 +263,12 @@ class Categorie extends CommonObject
public $cats = array();
/**
- * @var array Mother of table
+ * @var array Mother of table
*/
public $motherof = array();
/**
- * @var array children
+ * @var Categorie[] children
*/
public $childs = array();
@@ -338,7 +338,7 @@ class Categorie extends CommonObject
/**
* Get map list
*
- * @return array
+ * @return array
*/
public function getMapList()
{
@@ -361,7 +361,7 @@ class Categorie extends CommonObject
/**
* Get MAP_ID
*
- * @return array
+ * @return array
*/
public function getMapId()
{
@@ -1105,7 +1105,7 @@ class Categorie extends CommonObject
/**
* Return direct children ids of a category into an array
*
- * @return array|int Return integer <0 KO, array ok
+ * @return Categorie[]|int Return integer <0 KO, array ok
*/
public function get_filles()
{
@@ -1337,14 +1337,14 @@ class Categorie extends CommonObject
/**
* Returns all categories
*
- * @param int $type Type of category (0, 1, ...)
+ * @param ?int $type Type of category (0, 1, ...)
* @param boolean $parent Just parent categories if true
- * @return array|int Table of Object Category, -1 on error
+ * @return array|int<-1,-1> Table of Object Category, -1 on error
*/
public function get_all_categories($type = null, $parent = false)
{
// phpcs:enable
- if (!is_numeric($type)) {
+ if (!is_numeric($type) && !is_null($type)) {
$type = $this->MAP_ID[$type];
}
@@ -1376,8 +1376,8 @@ class Categorie extends CommonObject
/**
* Returns the top level categories (which are not child)
*
- * @param int $type Type of category (0, 1, ...)
- * @return array
+ * @param ?int $type Type of category (0, 1, ...)
+ * @return array|int<-1,-1> Table of Object Category, -1 on error
*/
public function get_main_categories($type = null)
{
@@ -1443,7 +1443,7 @@ class Categorie extends CommonObject
* @param string $url Url ('', 'none' or 'urltouse')
* @param int $nocolor 0
* @param int $addpicto Add picto into link
- * @return array
+ * @return string[]
*/
public function print_all_ways($sep = '>>', $url = '', $nocolor = 0, $addpicto = 0)
{
@@ -1850,9 +1850,9 @@ class Categorie extends CommonObject
/**
* Add the image uploaded as $file to the directory $sdir/-/photos/
*
- * @param string $sdir Root destination directory
- * @param array $file Uploaded file name
- * @return void
+ * @param string $sdir Root destination directory
+ * @param array{name:string,tmp_name:string} $file Uploaded file name
+ * @return void
*/
public function add_photo($sdir, $file)
{
@@ -1898,9 +1898,9 @@ class Categorie extends CommonObject
/**
* Return an array with all photos inside the directory
*
- * @param string $dir Dir to scan
- * @param int $nbmax Nombre maximum de photos (0=pas de max)
- * @return array Tableau de photos
+ * @param string $dir Dir to scan
+ * @param int $nbmax Nombre maximum de photos (0=pas de max)
+ * @return array Table with images
*/
public function liste_photos($dir, $nbmax = 0)
{
@@ -2179,7 +2179,7 @@ class Categorie extends CommonObject
*
* @param string $type The category type (e.g Categorie::TYPE_WAREHOUSE)
* @param string $rowIdName The name of the row id inside the whole sql query (e.g. "e.rowid")
- * @param Array $searchList A list with the selected categories
+ * @param string[] $searchList A list with the selected categories
* @return string A additional SQL SELECT query
* @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN
*/
diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php
index 3e134a91669..a96dc3486f8 100644
--- a/htdocs/comm/propal/class/propalestats.class.php
+++ b/htdocs/comm/propal/class/propalestats.class.php
@@ -137,7 +137,7 @@ class PropaleStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with number by month
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -161,7 +161,7 @@ class PropaleStats extends Stats
/**
* Return propals number per year
*
- * @return array Array with number by year
+ * @return array Array of nb each year
*
*/
public function getNbByYear()
@@ -186,7 +186,7 @@ class PropaleStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -211,7 +211,7 @@ class PropaleStats extends Stats
* Return the propals amount average by month for a year
*
* @param int $year year for stats
- * @return array array with number by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -234,7 +234,7 @@ class PropaleStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array with nb, total amount, average for each year
*/
public function getAllByYear()
{
diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php
index 3db4d075dd4..c17659abe8b 100644
--- a/htdocs/comm/propal/stats/index.php
+++ b/htdocs/comm/propal/stats/index.php
@@ -334,7 +334,7 @@ print '';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
- while (!empty($year) && $oldyear > $year + 1) { // If we have empty year
+ while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '
';
diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php
index ca2bc3e8826..f7fb16a08d2 100644
--- a/htdocs/commande/class/commandestats.class.php
+++ b/htdocs/commande/class/commandestats.class.php
@@ -5,6 +5,7 @@
* Copyright (C) 2012 Marcos García
* Copyright (C) 2020 Maxime DEMAREST
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -150,7 +151,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with number by month
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -174,7 +175,7 @@ class CommandeStats extends Stats
/**
* Return orders number per year
*
- * @return array Array with number by year
+ * @return array Array of nb each year
*
*/
public function getNbByYear()
@@ -199,7 +200,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -224,7 +225,7 @@ class CommandeStats extends Stats
* Return the orders amount average by month for a year
*
* @param int $year year for stats
- * @return array array with number by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -247,7 +248,7 @@ class CommandeStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
@@ -271,7 +272,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $limit Limit
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAllByProduct($year, $limit = 10)
{
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index adb5ab5b7d8..72c265f8242 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -136,6 +136,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
// $data = array(array('Lib',val1,val2,val3),...)
+$fileurlnb = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@@ -183,6 +184,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)
+$fileurlamount = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@@ -228,6 +230,8 @@ if (!$mesg) {
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
+
+$fileurl_avg = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@@ -334,6 +338,8 @@ if ($user->admin) {
}
print '
';
// Category
+$cat_type = 0;
+$cat_label = '';
if ($mode == 'customer') {
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
@@ -398,7 +404,7 @@ print '';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
- while (!empty($year) && $oldyear > $year + 1) { // If we have empty year
+ while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '
';
diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php
index 6f2d814d298..aabb1b77f38 100644
--- a/htdocs/compta/deplacement/class/deplacementstats.class.php
+++ b/htdocs/compta/deplacement/class/deplacementstats.class.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville
* Copyright (c) 2005-2008 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
+ * Copyright (C) 2024 MDW
*
* 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
@@ -35,11 +36,26 @@ class DeplacementStats extends Stats
*/
public $table_element;
+ /**
+ * @var int
+ */
public $socid;
+ /**
+ * @var int
+ */
public $userid;
+ /**
+ * @var string
+ */
public $from;
+ /**
+ * @var string
+ */
public $field;
+ /**
+ * @var string
+ */
public $where;
/**
@@ -47,7 +63,7 @@ class DeplacementStats extends Stats
*
* @param DoliDB $db Database handler
* @param int $socid Id third party
- * @param mixed $userid Id user for filter or array of user ids
+ * @param int|int[] $userid Id user for filter or array of user ids
* @return void
*/
public function __construct($db, $socid = 0, $userid = 0)
@@ -78,7 +94,7 @@ class DeplacementStats extends Stats
/**
* Renvoie le nombre de facture par annee
*
- * @return array Array of values
+ * @return array Array of nb each year
*/
public function getNbByYear()
{
@@ -96,7 +112,7 @@ class DeplacementStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -118,7 +134,7 @@ class DeplacementStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -138,7 +154,7 @@ class DeplacementStats extends Stats
* Return average amount
*
* @param int $year Year to scan
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -155,7 +171,7 @@ class DeplacementStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php
index 33520b4d3b6..55b28a9102d 100644
--- a/htdocs/compta/deplacement/stats/index.php
+++ b/htdocs/compta/deplacement/stats/index.php
@@ -167,6 +167,7 @@ if (!$mesg) {
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
+$filename_avg = '';
if (!$user->hasRight('societe', 'client', 'voir')) {
$filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
if ($mode == 'customer') {
@@ -282,7 +283,7 @@ print '
';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
- while ($year && $oldyear > $year + 1) { // If we have empty year
+ while ($year && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '
';
diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php
index bde740a2666..9750fff5f5b 100644
--- a/htdocs/compta/facture/class/facturestats.class.php
+++ b/htdocs/compta/facture/class/facturestats.class.php
@@ -154,7 +154,7 @@ class FactureStats extends Stats
/**
* Return invoices number per year
*
- * @return array Array with number by year
+ * @return array Array of nb each year
*/
public function getNbByYear()
{
@@ -228,7 +228,7 @@ class FactureStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php
index 2499ec19ff1..a372e6013a8 100644
--- a/htdocs/core/class/stats.class.php
+++ b/htdocs/core/class/stats.class.php
@@ -424,7 +424,7 @@ abstract class Stats
* Return nb of elements, total amount and avg amount each year
*
* @param string $sql SQL request
- * @return array Array with nb, total amount, average for each year
+ * @return array Array with nb, total amount, average for each year
*/
protected function _getAllByYear($sql)
{
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index 4cc81b629bd..3d29f9c3e58 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -213,7 +213,7 @@ class Translate
/**
* Load translation files.
*
- * @param array $domains Array of lang files to load
+ * @param string[] $domains Array of lang files to load
* @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
public function loadLangs($domains)
@@ -243,12 +243,12 @@ class Translate
* If $domain is "file@module" instead of "file" then we look for module lang file
* in htdocs/custom/modules/mymodule/langs/code_CODE/file.lang
* then in htdocs/module/langs/code_CODE/file.lang instead of htdocs/langs/code_CODE/file.lang
- * @param integer $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US)
+ * @param int $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US)
* @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed)
* @param string $forcelangdir To force a different lang directory
* @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf.
* @param int $forceloadifalreadynotfound Force attempt to reload lang file if it was previously not found
- * @param array $tabtranslatedomain Store translations to be stored in cache
+ * @param array $tabtranslatedomain Store translations to be stored in cache
* @param string $langkey To create key for cachekey in recursivity
* @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @see loadLangs()
@@ -867,11 +867,11 @@ class Translate
/**
* Return list of all available languages
*
- * @param string $langdir Directory to scan
- * @param integer $maxlength Max length for each value in combo box (will be truncated)
- * @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code
- * @param int $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
- * @return array List of languages
+ * @param string $langdir Directory to scan
+ * @param int $maxlength Max length for each value in combo box (will be truncated)
+ * @param int<0,1> $usecode 1=Show code instead of country name for language variant, 2=Show only code
+ * @param int<0,1> $mainlangonly 1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
+ * @return array List of languages
*/
public function get_available_languages($langdir = DOL_DOCUMENT_ROOT, $maxlength = 0, $usecode = 0, $mainlangonly = 0)
{
@@ -1195,7 +1195,7 @@ class Translate
* Return an array with content of all loaded translation keys (found into this->tab_translate) so
* we get a substitution array we can use for substitutions (for mail or ODT generation for example)
*
- * @return array Array of translation keys lang_key => string_translation_loaded
+ * @return array Array of translation keys lang_key => string_translation_loaded
*/
public function get_translations_for_substitutions()
{
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 0464f172375..f3e67229b67 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -2076,7 +2076,7 @@ function phpinfo_array()
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function company_admin_prepare_head()
{
@@ -2115,7 +2115,7 @@ function company_admin_prepare_head()
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function email_admin_prepare_head()
{
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 0032de1b22c..cbcdf3b0019 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -512,7 +512,7 @@ function actions_prepare_head($object)
* Define head array for tabs of agenda setup pages
*
* @param string $param Parameters to add to url
- * @return array Array of head
+ * @return array Array of tabs to show
*/
function calendars_prepare_head($param)
{
diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php
index cd4e8431cf9..6ced74e5966 100644
--- a/htdocs/core/lib/asset.lib.php
+++ b/htdocs/core/lib/asset.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2022-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -178,7 +179,7 @@ function assetPrepareHead(Asset $object)
* Prepare array of tabs for AssetModel
*
* @param AssetModel $object AssetModel
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function assetModelPrepareHead($object)
{
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index c1337f02968..ece419a576b 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -38,7 +38,7 @@
* Return array of tabs to used on pages for third parties cards.
*
* @param Societe $object Object company shown
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function societe_prepare_head(Societe $object)
{
@@ -477,7 +477,7 @@ function societe_prepare_head(Societe $object)
* Return array of tabs to used on page
*
* @param Object $object Object for tabs
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function societe_prepare_head2($object)
{
@@ -503,7 +503,7 @@ function societe_prepare_head2($object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function societe_admin_prepare_head()
{
diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php
index b1a9f36432f..532b2652003 100644
--- a/htdocs/core/lib/contract.lib.php
+++ b/htdocs/core/lib/contract.lib.php
@@ -142,7 +142,7 @@ function contract_prepare_head(Contrat $object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function contract_admin_prepare_head()
{
diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php
index ba86ee940ad..c39f5b3719d 100644
--- a/htdocs/core/lib/cron.lib.php
+++ b/htdocs/core/lib/cron.lib.php
@@ -1,6 +1,7 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
/**
* Return array of tabs to used on pages to setup cron module.
*
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function cronadmin_prepare_head()
{
@@ -56,7 +57,7 @@ function cronadmin_prepare_head()
* Return array of tabs to used on a cron job
*
* @param Cronjob $object Object cron
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function cron_prepare_head(Cronjob $object)
{
diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php
index ffdff4a5f43..fb4c0b241c0 100644
--- a/htdocs/core/lib/ecm.lib.php
+++ b/htdocs/core/lib/ecm.lib.php
@@ -174,7 +174,7 @@ function ecm_prepare_head_fm($object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function ecm_admin_prepare_head()
{
diff --git a/htdocs/core/lib/eventorganization.lib.php b/htdocs/core/lib/eventorganization.lib.php
index 09ebc88a0b3..79510429856 100644
--- a/htdocs/core/lib/eventorganization.lib.php
+++ b/htdocs/core/lib/eventorganization.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2023 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function eventorganizationAdminPrepareHead()
{
diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php
index 7510a73569b..72646e4f34e 100644
--- a/htdocs/core/lib/expedition.lib.php
+++ b/htdocs/core/lib/expedition.lib.php
@@ -69,7 +69,7 @@ function expedition_prepare_head(Expedition $object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function expedition_admin_prepare_head()
{
diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php
index 518ed2d475f..3f13f3a6e44 100644
--- a/htdocs/core/lib/expensereport.lib.php
+++ b/htdocs/core/lib/expensereport.lib.php
@@ -94,7 +94,7 @@ function expensereport_prepare_head($object)
* It loads tabs from modules looking for the entity payment
*
* @param PaymentExpenseReport $object Current payment object
- * @return array Tabs for the payment section
+ * @return array Array of tabs to show
*/
function payment_expensereport_prepare_head(PaymentExpenseReport $object)
{
@@ -127,7 +127,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function expensereport_admin_prepare_head()
{
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index 121e41c3ee3..3d4e58ac624 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -283,7 +283,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function supplierorder_admin_prepare_head()
{
diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php
index 76361b759c4..e25ee0b5902 100644
--- a/htdocs/core/lib/holiday.lib.php
+++ b/htdocs/core/lib/holiday.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2022 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
* Return array head with list of tabs to view object information
*
* @param Object $object Holiday
- * @return array head
+ * @return array Array of tabs to show
*/
function holiday_prepare_head($object)
{
@@ -76,7 +77,7 @@ function holiday_prepare_head($object)
/**
* Return array head with list of tabs to view object information
*
- * @return array head
+ * @return array Array of tabs to show
*/
function holiday_admin_prepare_head()
{
diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php
index 77c380918a4..88176b3cff2 100644
--- a/htdocs/core/lib/hrm.lib.php
+++ b/htdocs/core/lib/hrm.lib.php
@@ -63,7 +63,7 @@ function establishment_prepare_head($object)
/**
* Return array head with list of tabs to view object information
*
- * @return array head
+ * @return array Array of tabs to show
*/
function hrm_admin_prepare_head()
{
diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php
index 371bc6ed7c1..ed84858103a 100644
--- a/htdocs/core/lib/import.lib.php
+++ b/htdocs/core/lib/import.lib.php
@@ -4,6 +4,7 @@
* Copyright (C) 2010 Regis Houssin
* Copyright (C) 2010 Juanjo Menent
* Copyright (C) 2018-2021 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -31,7 +32,7 @@
*
* @param string $param Params to add on url links
* @param int $maxstep Limit steps to maxstep or no limit if 0
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function import_prepare_head($param, $maxstep = 0)
{
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index d9b7928ba49..24dc64a36a8 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -33,7 +33,7 @@
* Initialize the array of tabs for customer invoice
*
* @param Facture $object Invoice object
- * @return array Array of head tabs
+ * @return array Array of tabs to show
*/
function facture_prepare_head($object)
{
@@ -164,7 +164,7 @@ function facture_prepare_head($object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function invoice_admin_prepare_head()
{
@@ -248,7 +248,7 @@ function invoice_admin_prepare_head()
* Return array head with list of tabs to view object information.
*
* @param FactureRec $object Invoice model object
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function invoice_rec_prepare_head($object)
{
@@ -311,7 +311,7 @@ function invoice_rec_prepare_head($object)
* Return array head with list of tabs to view object information.
*
* @param Facture $object Invoice object
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function supplier_invoice_rec_prepare_head($object)
{
@@ -366,7 +366,7 @@ function getNumberInvoicesPieChart($mode)
$amount_mode = (getDolGlobalInt('FACTURE_VALIDATED_IN_AMOUNT') == 1);
- $sql = "SELECT";
+ $sql = "SELECT";
$sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late30";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late15";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub15, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as latenow";
diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php
index 9b5c039372e..04bc6bedb1a 100644
--- a/htdocs/core/lib/ldap.lib.php
+++ b/htdocs/core/lib/ldap.lib.php
@@ -28,7 +28,7 @@
/**
* Initialize the array of tabs for customer invoice
*
- * @return array Array of head tabs
+ * @return array Array of tabs to show
*/
function ldap_prepare_head()
{
diff --git a/htdocs/core/lib/mailmanspip.lib.php b/htdocs/core/lib/mailmanspip.lib.php
index 5449da31228..095f275b9d2 100644
--- a/htdocs/core/lib/mailmanspip.lib.php
+++ b/htdocs/core/lib/mailmanspip.lib.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -24,7 +25,7 @@
/**
* Return array head with list of tabs to view object information
*
- * @return array Tabs of the module
+ * @return array Array of tabs to show
*/
function mailmanspip_admin_prepare_head()
{
diff --git a/htdocs/core/lib/multicurrency.lib.php b/htdocs/core/lib/multicurrency.lib.php
index 1be514c60eb..6172fda2065 100644
--- a/htdocs/core/lib/multicurrency.lib.php
+++ b/htdocs/core/lib/multicurrency.lib.php
@@ -56,7 +56,7 @@ function multicurrencyAdminPrepareHead()
/**
* Prepare array with list of currency tabs
*
- * @param array $aCurrencies Currencies array
+ * @param string[] $aCurrencies Currencies array
* @return array Array of tabs to show
*/
function multicurrencyLimitPrepareHead($aCurrencies)
diff --git a/htdocs/core/lib/oauth.lib.php b/htdocs/core/lib/oauth.lib.php
index ecd69c3d045..383546cf036 100644
--- a/htdocs/core/lib/oauth.lib.php
+++ b/htdocs/core/lib/oauth.lib.php
@@ -1,6 +1,7 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -359,7 +360,7 @@ function getSupportedOauth2Array()
/**
* Return array of tabs to used on pages to setup cron module.
*
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function oauthadmin_prepare_head()
{
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index d89d4897dc7..0f50d417ccc 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -174,7 +174,7 @@ function commande_prepare_head(Commande $object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function order_admin_prepare_head()
{
diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php
index a5e48935052..fa7ad623f3a 100644
--- a/htdocs/core/lib/payments.lib.php
+++ b/htdocs/core/lib/payments.lib.php
@@ -4,6 +4,7 @@
* Copyright (C) 2018-2024 Frédéric France
* Copyright (C) 2020 Abbes Bahfir
* Copyright (C) 2021 Waël Almoman
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
* It loads tabs from modules looking for the entity payment
*
* @param Paiement $object Current payment object
- * @return array Tabs for the payment section
+ * @return array Array of tabs for the payment section
*/
function payment_prepare_head(Paiement $object)
{
@@ -73,7 +74,7 @@ function payment_prepare_head(Paiement $object)
* It loads tabs from modules looking for the entity payment
*
* @param int $id ID of bank line
- * @return array Tabs for the Bankline section
+ * @return array Array of tabs for the Banline section
*/
function bankline_prepare_head($id)
{
@@ -108,7 +109,7 @@ function bankline_prepare_head($id)
* It loads tabs from modules looking for the entity payment_supplier
*
* @param Paiement $object Current payment object
- * @return array Tabs for the payment section
+ * @return array Tabs for the payment section
*/
function payment_supplier_prepare_head(Paiement $object)
{
diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php
index 460697a2813..830369fe846 100644
--- a/htdocs/core/lib/prelevement.lib.php
+++ b/htdocs/core/lib/prelevement.lib.php
@@ -123,7 +123,7 @@ function prelevement_check_config($type = 'direct-debit')
* @param BonPrelevement $object Member
* @param int $nbOfInvoices No of invoices
* @param int $nbOfSalaryInvoice No of salary invoices
- * @return array head
+ * @return array Array of tabs to show
*/
function bon_prelevement_prepare_head(BonPrelevement $object, $nbOfInvoices, $nbOfSalaryInvoice)
{
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index a809f438419..53383acad48 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -193,6 +193,7 @@ function product_prepare_head($object)
// Attachments
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
+ $upload_dir = '';
if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
}
@@ -315,10 +316,10 @@ function productlot_prepare_head($object)
/**
-* Return array head with list of tabs to view object information.
-*
-* @return array head array with tabs
-*/
+ * Return array head with list of tabs to view object information.
+ *
+ * @return array Array of tabs to show
+ */
function product_admin_prepare_head()
{
global $langs, $conf, $user, $db;
@@ -378,7 +379,7 @@ function product_admin_prepare_head()
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function product_lot_admin_prepare_head()
{
diff --git a/htdocs/core/lib/receiptprinter.lib.php b/htdocs/core/lib/receiptprinter.lib.php
index 7bbfbc66387..4999dab2894 100644
--- a/htdocs/core/lib/receiptprinter.lib.php
+++ b/htdocs/core/lib/receiptprinter.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2015 Frederic France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -28,7 +29,7 @@
* Define head array for tabs of receipt printer setup pages
*
* @param string $mode Mode
- * @return Array of head
+ * @return array Array of tabs to show
*/
function receiptprinteradmin_prepare_head($mode)
{
diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php
index 8bdaf599d78..2bacb7043b2 100644
--- a/htdocs/core/lib/resource.lib.php
+++ b/htdocs/core/lib/resource.lib.php
@@ -3,6 +3,7 @@
* Copyright (C) 2013 Jean-François Ferry
* Copyright (C) 2016 Gilles Poirier
* Copyright (C) 2023 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -28,7 +29,7 @@
* Prepare head for tabs
*
* @param Dolresource $object Object
- * @return array Array of head entries
+ * @return array Array of tabs to show
*/
function resource_prepare_head($object)
{
@@ -110,7 +111,7 @@ function resource_prepare_head($object)
/**
* Prepare head for admin tabs
*
- * @return array Array of head entries
+ * @return array Array of tabs to show
*/
function resource_admin_prepare_head()
{
diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php
index 6038510a7fa..4a6133a54a7 100644
--- a/htdocs/core/lib/salaries.lib.php
+++ b/htdocs/core/lib/salaries.lib.php
@@ -4,6 +4,7 @@
* Copyright (C) 2019 Alexandre Spangaro
* Copyright (C) 2021 Gauthier VERDOL
* Copyright (C) 2023 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
* It loads tabs from modules looking for the entity salaries
*
* @param Paiement $object Current salaries object
- * @return array Tabs for the salaries section
+ * @return array Tabs for the salaries section
*/
function salaries_prepare_head($object)
{
@@ -98,7 +99,7 @@ function salaries_prepare_head($object)
/**
* Return array head with list of tabs to view object information
*
- * @return array head
+ * @return array Array of tabs to show
*/
function salaries_admin_prepare_head()
{
diff --git a/htdocs/core/lib/socialnetwork.lib.php b/htdocs/core/lib/socialnetwork.lib.php
index 368b356f962..a195534d522 100644
--- a/htdocs/core/lib/socialnetwork.lib.php
+++ b/htdocs/core/lib/socialnetwork.lib.php
@@ -4,6 +4,7 @@
* Copyright (C) 2019 Alexandre Spangaro
* Copyright (C) 2021 Gauthier VERDOL
* Copyright (C) 2023 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -22,7 +23,7 @@
/**
* Function for return different onglet of socialnetworks admin page
- * @return array Tabs for the admin section
+ * @return array Tabs for the admin section
*/
function socialnetwork_prepare_head()
{
diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php
index c8cb6c22892..9a9238f91c1 100644
--- a/htdocs/core/lib/stock.lib.php
+++ b/htdocs/core/lib/stock.lib.php
@@ -87,7 +87,7 @@ function stock_prepare_head($object)
/**
* Return array head with list of tabs to view object information.
*
- * @return array head array with tabs
+ * @return array Array of tabs to show
*/
function stock_admin_prepare_head()
{
diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php
index c7714501d90..c956308145f 100644
--- a/htdocs/core/lib/takepos.lib.php
+++ b/htdocs/core/lib/takepos.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2022 Alexandre Spangaro
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare array with list of tabs
*
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function takepos_admin_prepare_head()
{
diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php
index 3ba2088e4b2..2ed7811961e 100644
--- a/htdocs/core/lib/ticket.lib.php
+++ b/htdocs/core/lib/ticket.lib.php
@@ -27,7 +27,7 @@
/**
* Build tabs for admin page
*
- * @return array
+ * @return array
*/
function ticketAdminPrepareHead()
{
@@ -79,7 +79,7 @@ function ticketAdminPrepareHead()
* Build tabs for a Ticket object
*
* @param Ticket $object Object Ticket
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function ticket_prepare_head($object)
{
@@ -218,12 +218,12 @@ function generate_random_id($car = 16)
/**
* Show http header, open body tag and show HTML header banner for public pages for tickets
*
- * @param string $title Title
- * @param string $head Head array
- * @param int $disablejs More content into html header
- * @param int $disablehead More content into html header
- * @param array $arrayofjs Array of complementary js files
- * @param array $arrayofcss Array of complementary css files
+ * @param string $title Title
+ * @param string $head Head array
+ * @param int<0,1> $disablejs More content into html header
+ * @param int<0,1> $disablehead More content into html header
+ * @param string[] $arrayofjs Array of complementary js files
+ * @param string[] $arrayofcss Array of complementary css files
* @return void
*/
function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [])
diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php
index c4bebcedbb6..814c741090f 100644
--- a/htdocs/core/lib/website.lib.php
+++ b/htdocs/core/lib/website.lib.php
@@ -512,8 +512,8 @@ function dolWebsiteSaveContent($content)
* @param string $containerref Ref of container to redirect to (Example: 'mypage' or 'mypage.php').
* @param string $containeraliasalt Ref of alternative aliases to redirect to.
* @param int $containerid Id of container.
- * @param int $permanent 0=Use temporary redirect 302, 1=Use permanent redirect 301
- * @param array $parameters Array of parameters to append to the URL.
+ * @param int<0,1> $permanent 0=Use temporary redirect 302, 1=Use permanent redirect 301
+ * @param array $parameters Array of parameters to append to the URL.
* @return void
*/
function redirectToContainer($containerref, $containeraliasalt = '', $containerid = 0, $permanent = 0, $parameters = array())
@@ -654,7 +654,7 @@ function includeContainer($containerref)
* 'Name', 'os'=>'Windows', 'price'=>10)); ?>
*
* @param string $type 'blogpost', 'product', 'software', 'organization', 'qa', ...
- * @param array $data Array of data parameters for structured data
+ * @param array $data Array of data parameters for structured data
* @return string HTML content
*/
function getStructuredData($type, $data = array())
@@ -862,7 +862,7 @@ function getStructuredData($type, $data = array())
/**
* Return HTML content to add as header card for an article, news or Blog Post or home page.
*
- * @param array $params Array of parameters
+ * @param ?array $params Array of parameters
* @return string HTML content
*/
function getSocialNetworkHeaderCards($params = null)
@@ -1106,7 +1106,7 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '')
* Return array with list of all public files of a given object.
*
* @param Object $object Object
- * @return array List of public files of object
+ * @return array List of public files of object
* @see getImagePublicURLOfObject()
*/
function getPublicFilesOfObject($object)
@@ -1163,11 +1163,11 @@ function getPublicFilesOfObject($object)
* @param string $searchstring Search string
* @param int $max Max number of answers
* @param string $sortfield Sort Fields
- * @param string $sortorder Sort order ('DESC' or 'ASC')
+ * @param 'DESC'|'ASC' $sortorder Sort order ('DESC' or 'ASC')
* @param string $langcode Language code ('' or 'en', 'fr', 'es', ...)
- * @param array $otherfilters Other filters
- * @param int $status 0 or 1, or -1 for both
- * @return array Array with results of search
+ * @param array $otherfilters Other filters
+ * @param int<-1,1> $status 0 or 1, or -1 for both
+ * @return array{list?:WebsitePage[],code?:string,message?:string} Array with results of search
*/
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '', $otherfilters = [], $status = 1)
{
@@ -1534,7 +1534,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
* Retrieves the details of a news post by its ID.
*
* @param string $postId The ID of the news post to retrieve.
- * @return array|int Return array if OK, -1 if KO
+ * @return array|int<-1,-1> Return array if OK, -1 if KO
*/
function getNewsDetailsById($postId)
{
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index 3d215cc3a6f..728a9856da1 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -559,7 +559,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
}
if ($localtax2_type && $localtax2ligne != 0) {
if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
- $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
+ $this->localtax2[$localtax2_type][$localtax2_rate] = (float) $localtax2ligne;
} else {
$this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
}
@@ -869,7 +869,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
* Show total to pay
*
* @param TCPDF $pdf Object PDF
- * @param Facture $object Object invoice
+ * @param SupplierProposal $object Object proposal
* @param int $deja_regle Montant deja regle
* @param int $posy Position depart
* @param Translate $outputlangs Object langs
@@ -1144,7 +1144,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
- $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
+ $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
}
}
@@ -1210,6 +1210,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $conf, $langs;
+ '@phan-var-force SupplierProposal $object';
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies"));
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php
index 72044b24b05..0713297269d 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php
@@ -694,7 +694,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
}
if ($localtax2_type && $localtax2ligne != 0) {
if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
- $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
+ $this->localtax2[$localtax2_type][$localtax2_rate] = (float) $localtax2ligne;
} else {
$this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
}
@@ -1146,7 +1146,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
- $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
+ $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
}
}
diff --git a/htdocs/don/class/donstats.class.php b/htdocs/don/class/donstats.class.php
index 1e8f9f09d47..b0e8440e2f7 100644
--- a/htdocs/don/class/donstats.class.php
+++ b/htdocs/don/class/donstats.class.php
@@ -3,6 +3,7 @@
* Copyright (c) 2005-2013 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2011 Juanjo Menent
+ * Copyright (C) 2024 MDW
*
* 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
@@ -38,7 +39,13 @@ class DonationStats extends Stats
*/
public $table_element;
+ /**
+ * @var int
+ */
public $socid;
+ /**
+ * @var int
+ */
public $userid;
/**
@@ -114,7 +121,7 @@ class DonationStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with number by month
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -132,7 +139,7 @@ class DonationStats extends Stats
/**
* Return shipments number per year
*
- * @return array Array with number by year
+ * @return array Array of nb each year
*
*/
public function getNbByYear()
@@ -152,7 +159,7 @@ class DonationStats extends Stats
*
* @param int $year Year
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of amount each month
+ * @return array,array{0:int<1,12>,1:int|float}> Array of amount each month
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -171,7 +178,7 @@ class DonationStats extends Stats
* Return average amount each month
*
* @param int $year Year
- * @return array Array of average each month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -189,7 +196,7 @@ class DonationStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php
index 2813f9a130c..783a9a45028 100644
--- a/htdocs/don/stats/index.php
+++ b/htdocs/don/stats/index.php
@@ -38,7 +38,7 @@ $WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
// Load translation files required by the page
-$langs->loadLangs("donations");
+$langs->loadLangs(array("donations"));
$userid = GETPOSTINT('userid');
$socid = GETPOSTINT('socid');
@@ -226,7 +226,7 @@ if (isModEnabled('category')) {
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
print '
';
diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php
index 75a5d47103e..492b5b4aa86 100644
--- a/htdocs/emailcollector/lib/emailcollector.lib.php
+++ b/htdocs/emailcollector/lib/emailcollector.lib.php
@@ -27,7 +27,7 @@
* Prepare array of tabs for EmailCollector
*
* @param EmailCollector $object EmailCollector
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function emailcollectorPrepareHead($object)
{
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index a6ad366354a..f232592f51a 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -120,18 +120,54 @@ class ConferenceOrBooth extends ActionComm
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'EvntOrgDraft', '1' => 'EvntOrgSuggested', '2' => 'EvntOrgConfirmed', '3' => 'EvntOrgNotQualified', '4' => 'EvntOrgDone', '9' => 'EvntOrgCancelled'),),
);
+ /**
+ * @var int
+ */
public $rowid;
+ /**
+ * @var int
+ */
public $id;
+ /**
+ * @var string
+ */
public $label;
+ /**
+ * @var int
+ */
public $fk_soc;
+ /**
+ * @var int
+ */
public $fk_project;
+ /**
+ * @var string
+ */
public $note;
+ /**
+ * @var int
+ */
public $fk_action;
+ /**
+ * @var int
+ */
public $datec;
+ /**
+ * @var int
+ */
public $fk_user_author;
+ /**
+ * @var int
+ */
public $fk_user_mod;
+ /**
+ * @var string
+ */
public $import_key;
+ /**
+ * @var int
+ */
public $status;
// END MODULEBUILDER PROPERTIES
@@ -714,7 +750,7 @@ class ConferenceOrBooth extends ActionComm
}
if (property_exists($this, 'amount')) {
$return .= ' ';
- $return .= ''.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).'';
+ $return .= ''.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).''; // @phan-suppress-current-line PhanUndeclaredProperty
}
if (method_exists($this, 'getLibStatut')) {
$return .= '
'.$this->getLibStatut(3).'
';
@@ -773,10 +809,10 @@ class ConferenceOrBooth extends ActionComm
*
* @param string $modele Force template to use ('' to not force)
* @param Translate $outputlangs object lang a utiliser pour traduction
- * @param int $hidedetails Hide details of lines
- * @param int $hidedesc Hide description
- * @param int $hideref Hide ref
- * @param null|array $moreparams Array to provide more information
+ * @param int<0,1> $hidedetails Hide details of lines
+ * @param int<0,1> $hidedesc Hide description
+ * @param int<0,1> $hideref Hide ref
+ * @param array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php
index 2945f6ae3fb..111da1e56ae 100644
--- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php
+++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php
@@ -28,7 +28,7 @@
*
* @param ConferenceOrBooth $object ConferenceOrBooth
* @param int $with_project Add project id to URL
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function conferenceorboothPrepareHead($object, $with_project = 0)
{
@@ -116,7 +116,7 @@ function conferenceorboothPrepareHead($object, $with_project = 0)
* Prepare array of tabs for ConferenceOrBooth Project tab
*
* @param Project $object Project
- * @return array
+ * @return array
*/
function conferenceorboothProjectPrepareHead($object)
{
@@ -191,7 +191,7 @@ function conferenceorboothProjectPrepareHead($object)
* Prepare array of tabs for ConferenceOrBoothAttendees
*
* @param ConferenceOrBoothAttendee $object ConferenceOrBoothAttendee
- * @return array> Array of tabs
+ * @return array Array of tabs
*/
function conferenceorboothAttendeePrepareHead($object)
{
diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php
index 425cd4a7e1b..d53bd0e0628 100644
--- a/htdocs/expedition/class/expeditionstats.class.php
+++ b/htdocs/expedition/class/expeditionstats.class.php
@@ -3,6 +3,7 @@
* Copyright (c) 2005-2013 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2011 Juanjo Menent
+ * Copyright (C) 2024 MDW
*
* 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
@@ -112,7 +113,7 @@ class ExpeditionStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with number by month
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -135,7 +136,7 @@ class ExpeditionStats extends Stats
/**
* Return shipments number per year
*
- * @return array Array with number by year
+ * @return array Array of nb each year
*
*/
public function getNbByYear()
@@ -159,7 +160,7 @@ class ExpeditionStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -183,7 +184,7 @@ class ExpeditionStats extends Stats
* Return the orders amount average by month for a year
*
* @param int $year year for stats
- * @return array array with number by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -205,7 +206,7 @@ class ExpeditionStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php
index f8d905475c2..f21be7acba5 100644
--- a/htdocs/expedition/stats/index.php
+++ b/htdocs/expedition/stats/index.php
@@ -262,7 +262,7 @@ print '
';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
- while (!empty($year) && $oldyear > $year + 1) { // If we have empty year
+ while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php
index 5f1c0858959..8b25b65281a 100644
--- a/htdocs/expensereport/class/expensereportstats.class.php
+++ b/htdocs/expensereport/class/expensereportstats.class.php
@@ -3,6 +3,7 @@
* Copyright (c) 2005-2008 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -112,7 +113,7 @@ class ExpenseReportStats extends Stats
/**
* Return nb of expense report per year
*
- * @return array Array of values
+ * @return array Array of nb each year
*/
public function getNbByYear()
{
@@ -130,7 +131,7 @@ class ExpenseReportStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -152,7 +153,7 @@ class ExpenseReportStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -172,7 +173,7 @@ class ExpenseReportStats extends Stats
* Return average amount
*
* @param int $year Year to scan
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -189,7 +190,7 @@ class ExpenseReportStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php
index c302138a8bd..34e87c54b64 100644
--- a/htdocs/expensereport/stats/index.php
+++ b/htdocs/expensereport/stats/index.php
@@ -3,6 +3,7 @@
* Copyright (c) 2004-2012 Laurent Destailleur
* Copyright (C) 2012 Marcos García
* Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -39,7 +40,8 @@ $mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
$object_status = GETPOST('object_status', 'intcomma');
$userid = GETPOSTINT('userid');
-$socid = GETPOSTINT('socid'); if ($socid < 0) {
+$socid = GETPOSTINT('socid');
+if ($socid < 0) {
$socid = 0;
}
$id = GETPOSTINT('id');
@@ -272,7 +274,7 @@ print '';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
- while ($year && $oldyear > $year + 1) { // If we have empty year
+ while ($year && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '
';
diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php
index d5d58ec8bfd..c2f7fbd7638 100644
--- a/htdocs/fichinter/class/fichinterstats.class.php
+++ b/htdocs/fichinter/class/fichinterstats.class.php
@@ -91,7 +91,7 @@ class FichinterStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with number by month
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -114,7 +114,7 @@ class FichinterStats extends Stats
/**
* Return interventions number per year
*
- * @return array Array with number by year
+ * @return array Array of nb each year
*
*/
public function getNbByYear()
@@ -138,7 +138,7 @@ class FichinterStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -162,7 +162,7 @@ class FichinterStats extends Stats
* Return the intervention amount average by month for a year
*
* @param int $year year for stats
- * @return array array with number by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -184,7 +184,7 @@ class FichinterStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php
index cdd926c9471..63af162e404 100644
--- a/htdocs/fichinter/stats/index.php
+++ b/htdocs/fichinter/stats/index.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -271,7 +272,7 @@ print '
';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
- while (!empty($year) && $oldyear > $year + 1) {
+ while (!empty($year) && $oldyear > (int) $year + 1) {
// If we have empty year
$oldyear--;
diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php
index 88a851f0137..3dd00c38b62 100644
--- a/htdocs/hrm/lib/hrm.lib.php
+++ b/htdocs/hrm/lib/hrm.lib.php
@@ -5,6 +5,7 @@
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
* Copyright (C) 2022 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -29,7 +30,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function hrmAdminPrepareHead()
{
diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php
index adeb2637445..69df852cadf 100644
--- a/htdocs/hrm/lib/hrm_job.lib.php
+++ b/htdocs/hrm/lib/hrm_job.lib.php
@@ -3,6 +3,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2024 MDW
*
* 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
@@ -28,7 +29,7 @@
* Prepare array of tabs for Job
*
* @param Job $object Job
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function jobPrepareHead($object)
{
diff --git a/htdocs/hrm/lib/hrm_position.lib.php b/htdocs/hrm/lib/hrm_position.lib.php
index 2cb05a9593b..c21c042bbc6 100644
--- a/htdocs/hrm/lib/hrm_position.lib.php
+++ b/htdocs/hrm/lib/hrm_position.lib.php
@@ -3,6 +3,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2024 MDW
*
* 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
@@ -29,7 +30,7 @@
* Prepare array of tabs for positions
*
* @param Position $object Position
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function positionCardPrepareHead($object)
{
diff --git a/htdocs/hrm/lib/hrm_skill.lib.php b/htdocs/hrm/lib/hrm_skill.lib.php
index c3b7b892c79..9c5a61c158c 100644
--- a/htdocs/hrm/lib/hrm_skill.lib.php
+++ b/htdocs/hrm/lib/hrm_skill.lib.php
@@ -3,6 +3,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2024 MDW
*
* 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
@@ -28,7 +29,7 @@
* Prepare array of tabs for Skill
*
* @param Skill $object Skill
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function skillPrepareHead($object)
{
diff --git a/htdocs/hrm/lib/hrm_skilldet.lib.php b/htdocs/hrm/lib/hrm_skilldet.lib.php
index 1ba52808f28..679fae5ffb0 100644
--- a/htdocs/hrm/lib/hrm_skilldet.lib.php
+++ b/htdocs/hrm/lib/hrm_skilldet.lib.php
@@ -3,6 +3,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2024 MDW
*
* 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
@@ -28,7 +29,7 @@
* Prepare array of tabs for Skilldet
*
* @param Skilldet $object Skilldet
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function skilldetPrepareHead($object)
{
diff --git a/htdocs/hrm/lib/hrm_skillrank.lib.php b/htdocs/hrm/lib/hrm_skillrank.lib.php
index 1d0083ea37f..6ab9e994f5e 100644
--- a/htdocs/hrm/lib/hrm_skillrank.lib.php
+++ b/htdocs/hrm/lib/hrm_skillrank.lib.php
@@ -3,6 +3,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2024 MDW
*
* 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
@@ -28,7 +29,7 @@
* Prepare array of tabs for SkillRank
*
* @param SkillRank $object SkillRank
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function skillrankPrepareHead($object)
{
@@ -115,7 +116,7 @@ function displayRankInfos($selected_rank, $fk_skill, $inputname = 'TNote', $mode
$skilldet = new Skilldet($db);
$Lines = $skilldet->fetchAll('ASC', 'rankorder', 0, 0, '(fk_skill:=:'.((int) $fk_skill).')');
- if (!is_array($Lines) && $Lines<0) {
+ if (!is_array($Lines) && $Lines < 0) {
setEventMessages($skilldet->error, $skilldet->errors, 'errors');
}
if (empty($Lines)) {
diff --git a/htdocs/intracommreport/lib/intracommreport.lib.php b/htdocs/intracommreport/lib/intracommreport.lib.php
index ad19b8002af..27467f2a125 100644
--- a/htdocs/intracommreport/lib/intracommreport.lib.php
+++ b/htdocs/intracommreport/lib/intracommreport.lib.php
@@ -1,5 +1,6 @@
*
* 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
@@ -24,7 +25,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function intracommreportAdminPrepareHead()
{
@@ -75,7 +76,7 @@ function intracommreportAdminPrepareHead()
* Prepare array of tabs for IntraCommReport
*
* @param IntraCommReport $object IntraCommReport
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function intracommreportPrepareHead($object)
{
diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php
index f6d94797387..abf1958dedb 100644
--- a/htdocs/margin/lib/margins.lib.php
+++ b/htdocs/margin/lib/margins.lib.php
@@ -27,7 +27,7 @@
/**
* Define head array for tabs of marges tools setup pages
*
- * @return Array of head
+ * @return array Array of tabs to show
*/
function marges_admin_prepare_head()
{
@@ -55,7 +55,7 @@ function marges_admin_prepare_head()
/**
* Return array of tabs to used on pages for third parties cards.
*
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function marges_prepare_head()
{
diff --git a/htdocs/mrp/lib/mrp.lib.php b/htdocs/mrp/lib/mrp.lib.php
index 20840d40e1b..17e1eae0639 100644
--- a/htdocs/mrp/lib/mrp.lib.php
+++ b/htdocs/mrp/lib/mrp.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function mrpAdminPrepareHead()
{
diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php
index 63f39445e91..3b135210fdd 100644
--- a/htdocs/mrp/lib/mrp_mo.lib.php
+++ b/htdocs/mrp/lib/mrp_mo.lib.php
@@ -1,6 +1,7 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
* Prepare array of tabs for Mo
*
* @param Mo $object Mo
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function moPrepareHead($object)
{
diff --git a/htdocs/opensurvey/lib/opensurvey.lib.php b/htdocs/opensurvey/lib/opensurvey.lib.php
index 6ec2ee54605..cec135abe00 100644
--- a/htdocs/opensurvey/lib/opensurvey.lib.php
+++ b/htdocs/opensurvey/lib/opensurvey.lib.php
@@ -29,7 +29,7 @@
* It loads tabs from modules looking for the entity Opensurveyso
*
* @param Opensurveysondage $object Current viewing poll
- * @return array Tabs for the opensurvey section
+ * @return array Tabs for the opensurvey section
*/
function opensurvey_prepare_head(Opensurveysondage $object)
{
diff --git a/htdocs/partnership/lib/partnership.lib.php b/htdocs/partnership/lib/partnership.lib.php
index f5822e20a16..92ae9e1c4db 100644
--- a/htdocs/partnership/lib/partnership.lib.php
+++ b/htdocs/partnership/lib/partnership.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function partnershipAdminPrepareHead()
{
@@ -78,7 +79,7 @@ function partnershipAdminPrepareHead()
* Prepare array of tabs for Partnership
*
* @param Partnership $object Partnership
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function partnershipPrepareHead($object)
{
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index 13733e2be52..8ba85109cb8 100644
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
/**
* Define head array for tabs of paypal tools setup pages
*
- * @return Array of head
+ * @return array Array of tabs to show
*/
function paypaladmin_prepare_head()
{
diff --git a/htdocs/printing/lib/printing.lib.php b/htdocs/printing/lib/printing.lib.php
index 291ebd46ca8..fc038c68c3a 100644
--- a/htdocs/printing/lib/printing.lib.php
+++ b/htdocs/printing/lib/printing.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -28,7 +29,7 @@
* Define head array for tabs of printing tools setup pages
*
* @param string $mode Mode
- * @return array Array of head
+ * @return array Array of tabs to show
*/
function printingAdminPrepareHead($mode)
{
diff --git a/htdocs/product/inventory/lib/inventory.lib.php b/htdocs/product/inventory/lib/inventory.lib.php
index a3534229246..cff17432fe7 100644
--- a/htdocs/product/inventory/lib/inventory.lib.php
+++ b/htdocs/product/inventory/lib/inventory.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2015 ATM Consulting
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Define head array for tabs of inventory tools setup pages
*
- * @return array Array of head
+ * @return array Array of tabs to show
*/
function inventoryAdminPrepareHead()
{
@@ -64,7 +65,7 @@ function inventoryAdminPrepareHead()
* @param string $title parameter
* @param string $get parameter
*
- * @return array Array of head
+ * @return array Array of tabs to show
*/
function inventoryPrepareHead(&$inventory, $title = 'Inventory', $get = '')
{
@@ -75,7 +76,7 @@ function inventoryPrepareHead(&$inventory, $title = 'Inventory', $get = '')
array(dol_buildpath('/product/inventory/inventory.php?id='.$inventory->id.$get, 1), $langs->trans('Inventory'), 'inventory')
);
- $h=2;
+ $h = 2;
complete_head_from_modules($conf, $langs, $inventory, $head, $h, 'inventory');
complete_head_from_modules($conf, $langs, $inventory, $head, $h, 'inventory', 'remove');
diff --git a/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php b/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php
index 90fd3f25ba9..0392e51dff0 100644
--- a/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php
+++ b/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php
@@ -1,6 +1,7 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function stocktransferAdminPrepareHead()
{
diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php
index 5c4e6c2045a..48500e722be 100644
--- a/htdocs/projet/class/projectstats.class.php
+++ b/htdocs/projet/class/projectstats.class.php
@@ -135,7 +135,7 @@ class ProjectStats extends Stats
/**
* Return count, and sum of products
*
- * @return array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
@@ -237,7 +237,7 @@ class ProjectStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -262,7 +262,7 @@ class ProjectStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -374,7 +374,7 @@ class ProjectStats extends Stats
*
* @param int $year Year to scan
* @param int $wonlostfilter Add a filter on status won/lost
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getWeightedAmountByMonth($year, $wonlostfilter = 1)
{
@@ -482,7 +482,7 @@ class ProjectStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getTransformRateByMonth($year, $format = 0)
{
@@ -531,7 +531,7 @@ class ProjectStats extends Stats
/**
* Return average of entity by month
* @param int $year year number
- * @return array
+ * @return array,array{0:int<1,12>,1:int|float}> Array with number by month
*/
protected function getAverageByMonth($year)
{
diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php
index 9d792420754..b4290635b7e 100644
--- a/htdocs/projet/class/taskstats.class.php
+++ b/htdocs/projet/class/taskstats.class.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -113,7 +114,7 @@ class TaskStats extends Stats
/**
* Return count, and sum of products
*
- * @return array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
@@ -173,7 +174,7 @@ class TaskStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -201,7 +202,7 @@ class TaskStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array with amount by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAmountByMonth($year, $format = 0)
{
diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php
index eb99b0d35d1..6a3bcc6724a 100644
--- a/htdocs/projet/stats/index.php
+++ b/htdocs/projet/stats/index.php
@@ -1,6 +1,7 @@
* Copyright (C) 2015-2021 Laurent Destailleur
+ * Copyright (C) 2024 MDW
*
* 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
@@ -279,7 +280,7 @@ print '';
$oldyear = 0;
foreach ($data_all_year as $val) {
$year = $val['year'];
- while ($year && $oldyear > $year + 1) { // If we have empty year
+ while ($year && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '
';
diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php
index fc6bdc33d97..04e2b9fbccf 100644
--- a/htdocs/projet/tasks/stats/index.php
+++ b/htdocs/projet/tasks/stats/index.php
@@ -1,6 +1,7 @@
* Copyright (C) 2015 Laurent Destailleur
+ * Copyright (C) 2024 MDW
*
* 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
@@ -190,7 +191,7 @@ print '
';
$oldyear = 0;
foreach ($data_all_year as $val) {
$year = $val['year'];
- while ($year && $oldyear > $year + 1) { // If we have empty year
+ while ($year && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '
';
diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php
index eff1c46628b..e8fe227c50d 100644
--- a/htdocs/public/project/suggestbooth.php
+++ b/htdocs/public/project/suggestbooth.php
@@ -67,7 +67,7 @@ $error = 0;
$backtopage = GETPOST('backtopage', 'alpha');
$action = GETPOST('action', 'aZ09');
-$eventtype = GETPOST("eventtype");
+$eventtype = GETPOSTINT("eventtype");
$email = GETPOST("email");
$societe = GETPOST("societe");
$label = GETPOST("label");
diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php
index ff764b1fcae..ad1a877e085 100644
--- a/htdocs/public/project/suggestconference.php
+++ b/htdocs/public/project/suggestconference.php
@@ -67,7 +67,7 @@ $error = 0;
$backtopage = GETPOST('backtopage', 'alpha');
$action = GETPOST('action', 'aZ09');
-$eventtype = GETPOST("eventtype");
+$eventtype = GETPOSTINT("eventtype");
$email = GETPOST("email");
$societe = GETPOST("societe");
$label = GETPOST("label");
diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php
index fa62583f102..fb5bb7ac696 100644
--- a/htdocs/reception/class/receptionstats.class.php
+++ b/htdocs/reception/class/receptionstats.class.php
@@ -167,7 +167,7 @@ class ReceptionStats extends Stats
* Return the orders amount average by month for a year
*
* @param int $year year for stats
- * @return array,array{0:int<1,12>,1:int|float}> Array of average each month array with number by month
+ * @return array,array{0:int<1,12>,1:int|float}> Array of average each month
*/
public function getAverageByMonth($year)
{
@@ -189,7 +189,7 @@ class ReceptionStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array with nb, total amount, average for each year
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 3f74defca3c..f10db268366 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -113,6 +113,7 @@ if ($reshook < 0) {
if (empty($reshook)) {
$error = 0;
+ $objstat = null;
if ($action == 'add_element_resource' && !$cancel) {
$res = 0;
@@ -185,7 +186,7 @@ if (empty($reshook)) {
}
}
- if (!$error && $res > 0) {
+ if (!$error && $res > 0 && is_object($objstat)) {
setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs');
header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$objstat->id);
exit;
@@ -195,15 +196,15 @@ if (empty($reshook)) {
}
// Update resource
- if ($action == 'update_linked_resource' && $user->hasRight('resource', 'write') && !GETPOST('cancel', 'alpha')) {
+ if ($action == 'update_linked_resource' && $user->hasRight('resource', 'write') && !GETPOST('cancel', 'alpha') && is_object($objstat)) {
$res = $object->fetchElementResource($lineid);
if ($res) {
$object->busy = $busy;
$object->mandatory = $mandatory;
if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK') && $object->element_type == 'action' && $object->resource_type == 'dolresource' && intval($object->busy) == 1) {
- $eventDateStart = $object->objelement->datep;
- $eventDateEnd = $object->objelement->datef;
+ $eventDateStart = $object->objelement->datep; // @phan-suppress-current-line PhanUndeclaredProperty
+ $eventDateEnd = $object->objelement->datef; // @phan-suppress-current-line PhanUndeclaredProperty
$isFullDayEvent = $objstat->fulldayevent;
if (empty($eventDateEnd)) {
if ($isFullDayEvent) {
@@ -482,7 +483,7 @@ if (!$ret) {
$listofcontactid = array(); // not used yet
$listofotherid = array(); // not used yet
print '
';
/*if (in_array($user->id,array_keys($listofuserid)))
{
diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php
index ff54b229846..64269370560 100644
--- a/htdocs/salaries/class/paymentsalary.class.php
+++ b/htdocs/salaries/class/paymentsalary.class.php
@@ -80,13 +80,14 @@ class PaymentSalary extends CommonObject
public $datep = '';
/**
- * @deprecated
+ * @deprecated Use $amount
* @see $amount
+ * @var float|string
*/
public $total;
/**
- * @var float Total amount of payment
+ * @var float Total amount of payment
*/
public $amount;
@@ -102,7 +103,7 @@ class PaymentSalary extends CommonObject
/**
* @var string
- * @deprecated
+ * @deprecated Use $num_payment
*/
public $num_paiement;
@@ -295,7 +296,7 @@ class PaymentSalary extends CommonObject
//$deposits=$tmpsalary->getSumDepositsUsed();
$deposits = 0;
$alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
- $remaintopay = price2num($tmpsalary->amount - $paiement - $creditnotes - $deposits, 'MT');
+ $remaintopay = price2num((float) $tmpsalary->amount - $paiement - $creditnotes - $deposits, 'MT');
if ($remaintopay == 0) {
$result = $tmpsalary->setPaid($user);
} else {
diff --git a/htdocs/salaries/class/salariesstats.class.php b/htdocs/salaries/class/salariesstats.class.php
index 384e939787e..11c250fcab4 100644
--- a/htdocs/salaries/class/salariesstats.class.php
+++ b/htdocs/salaries/class/salariesstats.class.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2018 Alexandre Spangaro
* Copyright (c) 2018 Fidesio
* Copyright (C) 2021 Gauthier VERDOL
+ * Copyright (C) 2024 MDW
*
* 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
@@ -47,7 +48,7 @@ class SalariesStats extends Stats
*
* @param DoliDB $db Database handler
* @param int $socid Id third party
- * @param mixed $userid Id user for filter or array of user ids
+ * @param int|int[] $userid Id user for filter or array of user ids
* @return void
*/
public function __construct($db, $socid = 0, $userid = 0)
@@ -77,7 +78,7 @@ class SalariesStats extends Stats
/**
* Return the number of salary by year
*
- * @return array Array of values
+ * @return array Array of nb each year
*/
public function getNbByYear()
{
@@ -95,7 +96,7 @@ class SalariesStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values by month
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -117,7 +118,7 @@ class SalariesStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -137,7 +138,7 @@ class SalariesStats extends Stats
* Return average amount
*
* @param int $year Year to scan
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAverageByMonth($year)
{
@@ -154,7 +155,7 @@ class SalariesStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php
index 1daacafe330..5e8f0901494 100644
--- a/htdocs/salaries/class/salary.class.php
+++ b/htdocs/salaries/class/salary.class.php
@@ -67,10 +67,22 @@ class Salary extends CommonObject
*/
public $fk_user;
+ /**
+ * @var int|string
+ */
public $datep;
+ /**
+ * @var int|string
+ */
public $datev;
+ /**
+ * @var string
+ */
public $salary;
+ /**
+ * @var float|string
+ */
public $amount;
/**
@@ -78,7 +90,13 @@ class Salary extends CommonObject
*/
public $fk_project;
+ /**
+ * @var int
+ */
public $type_payment; // TODO Rename into type_payment_id
+ /**
+ * @var string
+ */
public $type_payment_code;
/**
@@ -86,7 +104,13 @@ class Salary extends CommonObject
*/
public $label;
+ /**
+ * @var int|string
+ */
public $datesp;
+ /**
+ * @var int|string
+ */
public $dateep;
/**
@@ -116,19 +140,22 @@ class Salary extends CommonObject
public $fk_user_modif;
/**
- * @var user User
+ * @var User
*/
public $user;
/**
- * @var int 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code)
- * @deprecated
+ * @var int<0,1> 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code)
+ * @deprecated Use $status and $close_code
*/
public $paye;
const STATUS_UNPAID = 0;
const STATUS_PAID = 1;
+ /**
+ * @var string
+ */
public $resteapayer;
public $fields = array(
@@ -847,7 +874,9 @@ class Salary extends CommonObject
$return .= '';
}
if (!empty($arraydata['user']) && is_object($arraydata['user'])) {
- $return .= ' '.$arraydata['user']->getNomUrl(empty($arraydata['user']->photo) ? 1 : -1, '', 0, 0, 16, 0, '', 'maxwidth100').'';
+ $user = $arraydata['user'];
+ '@phan-var-force User $user';
+ $return .= ' '.$user->getNomUrl(empty($arraydata['user']->photo) ? 1 : -1, '', 0, 0, 16, 0, '', 'maxwidth100').'';
}
if (property_exists($this, 'amount')) {
$return .= ' '.price($this->amount).'';
diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php
index 5f3165ed14b..b9095416ec3 100644
--- a/htdocs/salaries/paiement_salary.php
+++ b/htdocs/salaries/paiement_salary.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2004-2014 Laurent Destailleur
* Copyright (C) 2016-2018 Frédéric France
* Copyright (C) 2021 Gauthier VERDOL
+ * Copyright (C) 2024 MDW
*
* 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
@@ -282,7 +283,7 @@ if ($action == 'create') {
print '
';
} else {
diff --git a/htdocs/stripe/lib/stripe.lib.php b/htdocs/stripe/lib/stripe.lib.php
index de510a35d56..9f94fadd5eb 100644
--- a/htdocs/stripe/lib/stripe.lib.php
+++ b/htdocs/stripe/lib/stripe.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -27,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
/**
* Define head array for tabs of stripe tools setup pages
*
- * @return Array of head
+ * @return array Array of tabs to show
*/
function stripeadmin_prepare_head()
{
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index a3d739f5bd0..aa7f2274c78 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -290,7 +290,7 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOSTINT('cond_reglement_id');
$object->mode_reglement_id = GETPOSTINT('mode_reglement_id');
$object->fk_account = GETPOSTINT('fk_account');
- $object->socid = GETPOST('socid');
+ $object->socid = GETPOSTINT('socid');
$object->fk_project = GETPOSTINT('projectid');
$object->model_pdf = GETPOST('model');
$object->author = $user->id; // deprecated
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 6f573d2022b..d400c8e46f1 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -92,15 +92,25 @@ class SupplierProposal extends CommonObject
*/
protected $table_ref_field = 'ref';
+ /**
+ * @var int
+ */
public $socid; // Id client
/**
- * @deprecated
+ * @deprecated Use $user_author_id
* @see $user_author_id
+ * @var int
*/
public $author;
+ /**
+ * @var string
+ */
public $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande
+ /**
+ * @var string
+ */
public $ref_supplier; //Reference saisie lors de l'ajout d'une ligne à la demande
/**
@@ -120,43 +130,60 @@ class SupplierProposal extends CommonObject
public $delivery_date;
/**
- * @deprecated
+ * @deprecated Use $date_creation
* @see $date_creation
+ * @var int|string
*/
public $datec;
/**
- * @deprecated
+ * @deprecated Use $date_validation
* @see $date_validation
+ * @var int|string
*/
public $datev;
+ /**
+ * @var int
+ */
public $user_author_id;
/**
- * @deprecated
+ * @deprecated Use $price_ht
* @see $price_ht
+ * @var float
*/
public $price;
/**
- * @deprecated
+ * @deprecated Use $total_tva
* @see $total_tva
+ * @var float
*/
public $tva;
/**
- * @deprecated
+ * @deprecated Use $total_ttc
* @see $total_ttc
+ * @var float
*/
public $total;
+ /**
+ * @var string
+ */
public $cond_reglement_code;
+ /**
+ * @var string
+ */
public $cond_reglement_doc; // label doc
+ /**
+ * @var string
+ */
public $mode_reglement_code;
/**
- * @deprecated
+ * @deprecated Use $mode_reglement_code
* @var string Mode reglement
*/
public $mode_reglement;
@@ -166,12 +193,21 @@ class SupplierProposal extends CommonObject
*/
public $extraparams = array();
public $lines = array();
+ /**
+ * @var SupplierProposalLine
+ */
public $line;
public $labelStatus = array();
public $labelStatusShort = array();
+ /**
+ * @var int
+ */
public $nbtodo;
+ /**
+ * @var int
+ */
public $nbtodolate;
// Multicurrency
@@ -180,10 +216,25 @@ class SupplierProposal extends CommonObject
*/
public $fk_multicurrency;
+ /**
+ * @var string
+ */
public $multicurrency_code;
+ /**
+ * @var float
+ */
public $multicurrency_tx;
+ /**
+ * @var float
+ */
public $multicurrency_total_ht;
+ /**
+ * @var float
+ */
public $multicurrency_total_tva;
+ /**
+ * @var float
+ */
public $multicurrency_total_ttc;
/**
@@ -361,15 +412,15 @@ class SupplierProposal extends CommonObject
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*
* @param string $desc Description de la ligne
- * @param double $pu_ht Prix unitaire
- * @param double $qty Quantite
- * @param double $txtva Taux de tva
- * @param double $txlocaltax1 Local tax 1 rate
- * @param double $txlocaltax2 Local tax 2 rate
+ * @param float $pu_ht Prix unitaire
+ * @param float $qty Quantite
+ * @param float $txtva Taux de tva
+ * @param float $txlocaltax1 Local tax 1 rate
+ * @param float $txlocaltax2 Local tax 2 rate
* @param int $fk_product Product/Service ID predefined
- * @param double $remise_percent Percentage discount of the line
+ * @param float $remise_percent Percentage discount of the line
* @param string $price_base_type HT or TTC
- * @param double $pu_ttc Prix unitaire TTC
+ * @param float $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits of type of lines
* @param int $type Type of line (product, service)
* @param int $rang Position of line
@@ -378,12 +429,12 @@ class SupplierProposal extends CommonObject
* @param int $fk_fournprice Id supplier price. If 0, we will take best price. If -1 we keep it empty.
* @param int $pa_ht Buying price without tax
* @param string $label ???
- * @param array $array_options extrafields array
+ * @param array $array_options extrafields array
* @param string $ref_supplier Supplier price reference
* @param int $fk_unit Id of the unit to use.
* @param string $origin 'order', 'supplier_proposal', ...
* @param int $origin_id Id of origin line
- * @param double $pu_ht_devise Amount in currency
+ * @param float $pu_ht_devise Amount in currency
* @param int $date_start Date start
* @param int $date_end Date end
* @return int >0 if OK, <0 if KO
@@ -648,12 +699,12 @@ class SupplierProposal extends CommonObject
* Update a proposal line
*
* @param int $rowid Id de la ligne
- * @param double $pu Unit price (HT or TTC depending on price_base_type)
- * @param double $qty Quantity
- * @param double $remise_percent Discount on line
- * @param double $txtva VAT rate
- * @param double $txlocaltax1 Local tax 1 rate
- * @param double $txlocaltax2 Local tax 2 rate
+ * @param float $pu Unit price (HT or TTC depending on price_base_type)
+ * @param float $qty Quantity
+ * @param float $remise_percent Discount on line
+ * @param float $txtva VAT rate
+ * @param float $txlocaltax1 Local tax 1 rate
+ * @param float $txlocaltax2 Local tax 2 rate
* @param string $desc Description
* @param string $price_base_type HT or TTC
* @param int $info_bits Miscellaneous information
@@ -664,10 +715,10 @@ class SupplierProposal extends CommonObject
* @param int $pa_ht Price (without tax) of product when it was bought
* @param string $label ???
* @param int $type 0/1=Product/service
- * @param array $array_options extrafields array
+ * @param array $array_options extrafields array
* @param string $ref_supplier Supplier price reference
* @param int $fk_unit Id of the unit to use.
- * @param double $pu_ht_devise Unit price in currency
+ * @param float $pu_ht_devise Unit price in currency
* @return int 0 if OK, <0 if KO
*/
public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $array_options = [], $ref_supplier = '', $fk_unit = 0, $pu_ht_devise = 0)
@@ -1145,6 +1196,7 @@ class SupplierProposal extends CommonObject
require_once DOL_DOCUMENT_ROOT."/core/modules/supplier_proposal/" . getDolGlobalString('SUPPLIER_PROPOSAL_ADDON').'.php';
$obj = getDolGlobalString('SUPPLIER_PROPOSAL_ADDON');
$modSupplierProposal = new $obj();
+ '@phan-var-force ModeleNumRefSupplierProposal $modSupplierProposal';
$this->ref = $modSupplierProposal->getNextValue($objsoc, $this);
// Create clone
@@ -1541,7 +1593,7 @@ class SupplierProposal extends CommonObject
* Set an overall discount on the proposal
*
* @param User $user Object user that modify
- * @param double $remise Amount discount
+ * @param float $remise Amount discount
* @return int Return integer <0 if ko, >0 if ok
*/
/*
@@ -1574,7 +1626,7 @@ class SupplierProposal extends CommonObject
* Set an absolute overall discount on the proposal
*
* @param User $user Object user that modify
- * @param double $remise Amount discount
+ * @param float $remise Amount discount
* @return int Return integer <0 if ko, >0 if ok
*/
/*
@@ -1774,7 +1826,7 @@ class SupplierProposal extends CommonObject
}
$productsupplier->id = $product->fk_product;
- $productsupplier->update_buyprice($product->qty, $product->total_ht, $user, 'HT', $this->thirdparty, '', $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, '', '', array(), '', $product->multicurrency_total_ht, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', '');
+ $productsupplier->update_buyprice($product->qty, $product->total_ht, $user, 'HT', $this->thirdparty, 0, $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, 0, '', array(), '', $product->multicurrency_total_ht, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', 0);
}
return 1;
@@ -1930,7 +1982,7 @@ class SupplierProposal extends CommonObject
* @param int $offset For pagination
* @param string $sortfield Sort criteria
* @param string $sortorder Sort order
- * @return array|int -1 if KO, array with result if OK
+ * @return array|array|int<-1,-1> -1 if KO, array with result if OK
*/
public function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datec', $sortorder = 'DESC')
{
@@ -2237,6 +2289,7 @@ class SupplierProposal extends CommonObject
if ($resql) {
$label = $labelShort = '';
$status = '';
+ $delay_warning = 0;
if ($mode == 'opened') {
$delay_warning = !empty($conf->supplier_proposal->cloture->warning_delay) ? $conf->supplier_proposal->cloture->warning_delay : 0;
$status = self::STATUS_VALIDATED;
@@ -2430,6 +2483,7 @@ class SupplierProposal extends CommonObject
}
$obj = new $classname();
+ '@phan-var-force ModeleNumRefSupplierProposal $obj';
$numref = "";
$numref = $obj->getNextValue($soc, $this);
@@ -2676,13 +2730,13 @@ class SupplierProposal extends CommonObject
/**
* Create a document onto disk according to template module.
*
- * @param string $modele Force model to use ('' to not force)
- * @param Translate $outputlangs Object langs to use for output
- * @param int $hidedetails Hide details of lines
- * @param int $hidedesc Hide description
- * @param int $hideref Hide ref
- * @param null|array $moreparams Array to provide more information
- * @return int 0 if KO, 1 if OK
+ * @param string $modele Force model to use ('' to not force)
+ * @param Translate $outputlangs Object langs to use for output
+ * @param int<0,1> $hidedetails Hide details of lines
+ * @param int<0,1> $hidedesc Hide description
+ * @param int<0,1> $hideref Hide ref
+ * @param ?array $moreparams Array to provide more information
+ * @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
@@ -2821,6 +2875,9 @@ class SupplierProposalLine extends CommonObjectLine
*/
public $fk_parent_attribute = 'fk_supplier_proposal';
+ /**
+ * @var SupplierProposalLine
+ */
public $oldline;
/**
@@ -2838,6 +2895,9 @@ class SupplierProposalLine extends CommonObjectLine
*/
public $fk_parent_line;
+ /**
+ * @var string
+ */
public $desc; // Description ligne
/**
@@ -2846,8 +2906,9 @@ class SupplierProposalLine extends CommonObjectLine
public $fk_product; // Id produit predefini
/**
- * @deprecated
+ * @deprecated Use $product_type
* @see $product_type
+ * @var int
*/
public $fk_product_type;
/**
@@ -2861,7 +2922,13 @@ class SupplierProposalLine extends CommonObjectLine
* @var float Quantity
*/
public $qty;
+ /**
+ * @var float|string
+ */
public $tva_tx;
+ /**
+ * @var string
+ */
public $vat_src_code;
/**
@@ -2869,6 +2936,9 @@ class SupplierProposalLine extends CommonObjectLine
* @var float
*/
public $subprice;
+ /**
+ * @var float|string
+ */
public $remise_percent;
/**
@@ -2876,6 +2946,9 @@ class SupplierProposalLine extends CommonObjectLine
*/
public $fk_remise_except;
+ /**
+ * @var int
+ */
public $rang = 0;
/**
@@ -2883,8 +2956,17 @@ class SupplierProposalLine extends CommonObjectLine
*/
public $fk_fournprice;
+ /**
+ * @var int|float|string
+ */
public $pa_ht;
+ /**
+ * @var int|float
+ */
public $marge_tx;
+ /**
+ * @var int|float
+ */
public $marque_tx;
/**
@@ -2895,20 +2977,39 @@ class SupplierProposalLine extends CommonObjectLine
// 2: ecotaxe
// 3: option line (when qty = 0)
+ /**
+ * @var int
+ */
public $info_bits = 0; // Liste d'options cumulables:
// Bit 0: 0 si TVA normal - 1 if TVA NPR
// Bit 1: 0 ligne normal - 1 if fixed reduction
+ /**
+ * @var float
+ */
public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
+ /**
+ * @var float
+ */
public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
+ /**
+ * @var float
+ */
public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne
+ /**
+ * @var int|string
+ */
public $date_start;
+ /**
+ * @var int|string
+ */
public $date_end;
// From llx_product
/**
- * @deprecated
+ * @var string
+ * @deprecated Use $product_ref
* @see $product_ref
*/
public $ref;
@@ -2920,7 +3021,8 @@ class SupplierProposalLine extends CommonObjectLine
public $product_ref;
/**
- * @deprecated
+ * @var string
+ * @deprecated Use $product_label
* @see $product_label
*/
public $libelle;
@@ -2943,16 +3045,43 @@ class SupplierProposalLine extends CommonObjectLine
*/
public $product_desc;
+ /**
+ * @var int|string
+ */
public $localtax1_tx; // Local tax 1
+ /**
+ * @var int|string
+ */
public $localtax2_tx; // Local tax 2
+ /**
+ * @var string
+ */
public $localtax1_type; // Local tax 1 type
+ /**
+ * @var string
+ */
public $localtax2_type; // Local tax 2 type
+ /**
+ * @var float
+ */
public $total_localtax1; // Line total local tax 1
+ /**
+ * @var float
+ */
public $total_localtax2; // Line total local tax 2
+ /**
+ * @var int<0,1>
+ */
public $skip_update_total; // Skip update price total for special lines
+ /**
+ * @var string
+ */
public $ref_fourn;
+ /**
+ * @var string
+ */
public $ref_supplier;
// Multicurrency
@@ -2961,10 +3090,25 @@ class SupplierProposalLine extends CommonObjectLine
*/
public $fk_multicurrency;
+ /**
+ * @var string
+ */
public $multicurrency_code;
+ /**
+ * @var float
+ */
public $multicurrency_subprice;
+ /**
+ * @var float
+ */
public $multicurrency_total_ht;
+ /**
+ * @var float
+ */
public $multicurrency_total_tva;
+ /**
+ * @var float
+ */
public $multicurrency_total_ttc;
/**
@@ -3085,10 +3229,10 @@ class SupplierProposalLine extends CommonObjectLine
$this->localtax2_tx = 0;
}
if (empty($this->localtax1_type)) {
- $this->localtax1_type = 0;
+ $this->localtax1_type = '';
}
if (empty($this->localtax2_type)) {
- $this->localtax2_type = 0;
+ $this->localtax2_type = '';
}
if (empty($this->total_localtax1)) {
$this->total_localtax1 = 0;
@@ -3293,10 +3437,10 @@ class SupplierProposalLine extends CommonObjectLine
$this->total_localtax2 = 0;
}
if (empty($this->localtax1_type)) {
- $this->localtax1_type = 0;
+ $this->localtax1_type = '';
}
if (empty($this->localtax2_type)) {
- $this->localtax2_type = 0;
+ $this->localtax2_type = '';
}
if (empty($this->marque_tx)) {
$this->marque_tx = 0;
diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php
index 038b9cfbcba..c2226fe798e 100644
--- a/htdocs/takepos/admin/terminal.php
+++ b/htdocs/takepos/admin/terminal.php
@@ -4,6 +4,7 @@
* Copyright (C) 2021 Thibault FOUCART
* Copyright (C) 2022 Alexandre Spangaro
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -452,6 +453,7 @@ if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") {
require_once $dir.$filebis;
$module = new $classname($db);
+ '@phan-var-force ModeleNumRefFactures $module';
// Show modules according to features level
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php
index ae052f6243c..a491775376e 100644
--- a/htdocs/ticket/class/ticketstats.class.php
+++ b/htdocs/ticket/class/ticketstats.class.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -46,7 +47,7 @@ class TicketStats extends Stats
*
* @param DoliDB $db Database handler
* @param int $socid Id third party
- * @param mixed $userid Id user for filter or array of user ids
+ * @param int|int[] $userid Id user for filter or array of user ids
* @return void
*/
public function __construct($db, $socid = 0, $userid = 0)
@@ -76,7 +77,7 @@ class TicketStats extends Stats
/**
* Renvoie le nombre de tickets par annee
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getNbByYear()
{
@@ -93,7 +94,7 @@ class TicketStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -110,11 +111,11 @@ class TicketStats extends Stats
}
/**
- * Return th eamount of tickets for a month and a given year
+ * Return the number of tickets for a month and a given year
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -134,7 +135,7 @@ class TicketStats extends Stats
* Return average amount
*
* @param int $year Year to scan
- * @return array Array of values
+ * @return array,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAverageByMonth($year)
{
@@ -151,7 +152,7 @@ class TicketStats extends Stats
/**
* Return nb, total and average
*
- * @return array Array of values
+ * @return array Array of values
*/
public function getAllByYear()
{
diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php
index 721f4f30b12..99798ff54be 100644
--- a/htdocs/ticket/stats/index.php
+++ b/htdocs/ticket/stats/index.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -210,7 +211,7 @@ print '';
$oldyear = 0;
foreach ($data as $val) {
$year = $val['year'];
- while (!empty($year) && $oldyear > $year + 1) { // If we have empty year
+ while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
$oldyear--;
print '
';
diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php
index 1103e057c4b..39dfa719237 100644
--- a/htdocs/viewimage.php
+++ b/htdocs/viewimage.php
@@ -388,6 +388,7 @@ if ($modulepart == 'barcode') {
$classname = "mod".ucfirst($generator);
$module = new $classname($db);
+ '@phan-var-force ModeleBarCode $module';
if ($module->encodingIsSupported($encoding)) {
$result = $module->buildBarCode($code, $encoding, $readable);
}
diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php
index fb6aeec88e8..8ea07ced4ec 100644
--- a/htdocs/webhook/class/target.class.php
+++ b/htdocs/webhook/class/target.class.php
@@ -109,16 +109,49 @@ class Target extends CommonObject
'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'default' => '1', 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'AutomaticTrigger', '2' => 'ManualTrigger'), 'validate' => 1,),
"trigger_stack" => array("type" => "text", "label" => "TriggerStack", "enabled" => "1", 'position' => 59, 'notnull' => 0, "visible" => "0",),
);
+ /**
+ * @var int
+ */
public $rowid;
+ /**
+ * @var string
+ */
public $ref;
+ /**
+ * @var string
+ */
public $label;
+ /**
+ * @var string
+ */
public $description;
+ /**
+ * @var string
+ */
public $note_public;
+ /**
+ * @var string
+ */
public $note_private;
+ /**
+ * @var int
+ */
public $fk_user_creat;
+ /**
+ * @var int
+ */
public $fk_user_modif;
+ /**
+ * @var string
+ */
public $import_key;
+ /**
+ * @var int
+ */
public $status;
+ /**
+ * @var string
+ */
public $url;
/**
* @var string List of trigger codes separated by a comma. Example: 'BILL_VALIDATE,PROPAL_DELETE,...'
@@ -413,7 +446,7 @@ class Target extends CommonObject
* @param string $filter Filter as an Universal Search string.
* Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
* @param string $filtermode No more used
- * @return array|int int <0 if KO, array of pages if OK
+ * @return array|int<-1,-1> int <0 if KO, array of pages if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{
@@ -517,9 +550,9 @@ class Target extends CommonObject
/**
* Validate object
*
- * @param User $user User making status change
- * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
+ * @param User $user User making status change
+ * @param int<0,1> $notrigger 1=Does not execute triggers, 0= execute triggers
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -936,6 +969,7 @@ class Target extends CommonObject
if (class_exists($classname)) {
$obj = new $classname();
+ '@phan-var-force CommonNumRefGenerator $obj';
$numref = $obj->getNextValue($this);
if ($numref != '' && $numref != '-1') {
@@ -956,10 +990,10 @@ class Target extends CommonObject
*
* @param string $modele Force template to use ('' to not force)
* @param Translate $outputlangs object lang a utiliser pour traduction
- * @param int $hidedetails Hide details of lines
- * @param int $hidedesc Hide description
- * @param int $hideref Hide ref
- * @param null|array $moreparams Array to provide more information
+ * @param int<0,1> $hidedetails Hide details of lines
+ * @param int<0,1> $hidedesc Hide description
+ * @param int<0,1> $hideref Hide ref
+ * @param ?array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
diff --git a/htdocs/webhook/lib/webhook.lib.php b/htdocs/webhook/lib/webhook.lib.php
index 338361785a1..dbf6e2fdf9c 100644
--- a/htdocs/webhook/lib/webhook.lib.php
+++ b/htdocs/webhook/lib/webhook.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function webhookAdminPrepareHead()
{
diff --git a/htdocs/webhook/lib/webhook_target.lib.php b/htdocs/webhook/lib/webhook_target.lib.php
index 687b16e42f6..56f51ad6501 100644
--- a/htdocs/webhook/lib/webhook_target.lib.php
+++ b/htdocs/webhook/lib/webhook_target.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
* Prepare array of tabs for Target
*
* @param Target $object Target
- * @return array Returns an array of tabs
+ * @return array Array of tabs to show
*/
function targetPrepareHead($object)
{
diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php
index f47fd8dcad2..03c051bce4f 100644
--- a/htdocs/webportal/class/html.formwebportal.class.php
+++ b/htdocs/webportal/class/html.formwebportal.class.php
@@ -321,6 +321,7 @@ class FormWebPortal extends Form
if (empty($this->infofiles['extensions'][$ext])) {
$this->infofiles['extensions'][$ext] = 1;
} else {
+ // @phan-suppress-next-line PhanTypeInvalidDimOffset
$this->infofiles['extensions'][$ext]++;
}
diff --git a/htdocs/webportal/lib/webportal.lib.php b/htdocs/webportal/lib/webportal.lib.php
index a2f3fb0eff3..0b47205f0b2 100644
--- a/htdocs/webportal/lib/webportal.lib.php
+++ b/htdocs/webportal/lib/webportal.lib.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2023-2024 Laurent Destailleur
* Copyright (C) 2023-2024 Lionel Vessiller
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function webportalAdminPrepareHead()
{
diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php
index b584b88c091..fdb4104a397 100644
--- a/htdocs/webservices/server_category.php
+++ b/htdocs/webservices/server_category.php
@@ -202,7 +202,7 @@ $server->register(
/**
* Get category infos and children
*
- * @param array $authentication Array of authentication information
+ * @param array{login:string,entity?:int} $authentication Array of authentication information
* @param int $id Id of object
* @return mixed
*/
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index 9271b074786..bd2b2e8be86 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -244,9 +244,9 @@ class WebsitePage extends CommonObject
/**
* Create object into database
*
- * @param User $user User that creates
- * @param int $notrigger 0=launch triggers after, 1=disable triggers
- * @return int Return integer <0 if KO, Id of created object if OK
+ * @param User $user User that creates
+ * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
+ * @return int Return integer <0 if KO, Id of created object if OK
*/
public function create(User $user, $notrigger = 0)
{
@@ -272,9 +272,9 @@ class WebsitePage extends CommonObject
* @param int $id Id object.
* - If this is 0, the value into $page will be used. If not found or $page not defined, the default page of website_id will be used or the first page found if not set.
* - If value is < 0, we must exclude this ID.
- * @param string $website_id Web site id (page name must also be filled if this parameter is used)
- * @param string $page Page name (website id must also be filled if this parameter is used). Example 'myaliaspage' or 'fr/myaliaspage'
- * @param string $aliasalt Alternative alias to search page (slow)
+ * @param ?string $website_id Web site id (page name must also be filled if this parameter is used)
+ * @param ?string $page Page name (website id must also be filled if this parameter is used). Example 'myaliaspage' or 'fr/myaliaspage'
+ * @param ?string $aliasalt Alternative alias to search page (slow)
* @param int $translationparentid Translation parent ID (a main language page ID to get the translated page). Parameter $translationparentlang must also be set.
* @param string $translationparentlang Translation parent Lang (a language lang to search the translation of the main page ID). Parameter $translationparentid must also be set.
* @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK
@@ -403,8 +403,8 @@ class WebsitePage extends CommonObject
* @param string $sortfield Sort field
* @param int $limit limit
* @param int $offset Offset
- * @param string|array $filter Filter as an Universal Search string.
- * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
+ * @param string|string[] $filter Filter as an Universal Search string.
+ * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
* @param string $filtermode No more used
* @return WebSitePage[]|int<-1,-1> int <0 if KO, array of pages if OK
*/
@@ -550,8 +550,8 @@ class WebsitePage extends CommonObject
* Count objects in the database.
*
* @param string $websiteid Web site
- * @param string|array $filter Filter as an Universal Search string.
- * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
+ * @param string|string[] $filter Filter as an Universal Search string.
+ * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
* @param string $filtermode Filter mode (AND or OR)
* @return int int <0 if KO, array of pages if OK
*/
@@ -636,9 +636,9 @@ class WebsitePage extends CommonObject
/**
* Update object into database
*
- * @param User $user User that modifies
- * @param int $notrigger 0=launch triggers after, 1=disable triggers
- * @return int Return integer <0 if KO, >0 if OK
+ * @param User $user User that modifies
+ * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
+ * @return int Return integer <0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = 0)
{
@@ -735,15 +735,15 @@ class WebsitePage extends CommonObject
/**
* Load an object from its id and create a new one in database
*
- * @param User $user User making the clone
- * @param int $fromid Id of object to clone
- * @param string $newref New ref/alias of page
- * @param string $newlang New language
- * @param int $istranslation 1=New page is a translation of the cloned page.
- * @param int $newwebsite 0=Same web site, >0=Id of new website
- * @param string $newtitle New title
- * @param Website|null $website Website
- * @return mixed New object created, <0 if KO
+ * @param User $user User making the clone
+ * @param int $fromid Id of object to clone
+ * @param string $newref New ref/alias of page
+ * @param string $newlang New language
+ * @param int $istranslation 1=New page is a translation of the cloned page.
+ * @param int $newwebsite 0=Same web site, >0=Id of new website
+ * @param string $newtitle New title
+ * @param ?Website $website Website
+ * @return self|int<-1,-1> New object created, <0 if KO
*/
public function createFromClone(User $user, $fromid, $newref, $newlang = '', $istranslation = 0, $newwebsite = 0, $newtitle = '', $website = null)
{
@@ -859,12 +859,12 @@ class WebsitePage extends CommonObject
* Return a link to the user card (with optionally the picto)
* Use this->id,this->lastname, this->firstname
*
- * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
- * @param string $option On what the link point to
- * @param integer $notooltip 1=Disable tooltip
- * @param int $maxlen Max length of visible user name
- * @param string $morecss Add more css on link
- * @return string String with URL
+ * @param int<0,2> $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
+ * @param string $option On what the link point to
+ * @param int<0,1> $notooltip 1=Disable tooltip
+ * @param int $maxlen Max length of visible user name
+ * @param string $morecss Add more css on link
+ * @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '')
{
@@ -916,8 +916,8 @@ class WebsitePage extends CommonObject
/**
* Return the label of the status
*
- * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
- * @return string Label of status
+ * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
+ * @return string Label of status
*/
public function getLibStatut($mode = 0)
{
@@ -928,9 +928,9 @@ class WebsitePage extends CommonObject
/**
* Return the label of a given status
*
- * @param int $status Id status
- * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
- * @return string Label of status
+ * @param int $status Id status
+ * @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
+ * @return string Label of status
*/
public function LibStatut($status, $mode = 0)
{
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index eb834ab530c..6979702a314 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -3412,7 +3412,7 @@ if (!GETPOST('hide_websitemenu')) {
$formquestion[] = array('type' => 'checkbox', 'tdclass' => 'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0, 'morecss' => 'margintoponly');
}
- $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1);
+ $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, array(), $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1);
$formquestion[] = array('type' => 'other', 'name' => 'newlang', 'label' => $form->textwithpicto($langs->trans("Language"), $langs->trans("DefineListOfAltLanguagesInWebsiteProperties")), 'value' => $value);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550);
@@ -3872,9 +3872,9 @@ if ($action == 'editcss') {
} else {
$manifestjsoncontent = GETPOST('WEBSITE_MANIFEST_JSON', 'restricthtml');
}
- if (!trim($manifestjsoncontent)) {
- //$manifestjsoncontent.="";
- }
+ //if (!trim($manifestjsoncontent)) {
+ //$manifestjsoncontent.="";
+ //}
if (!GETPOSTISSET('WEBSITE_README')) {
$readmecontent = @file_get_contents($filereadme);
@@ -3883,9 +3883,9 @@ if ($action == 'editcss') {
} else {
$readmecontent = GETPOST('WEBSITE_README', 'restricthtmlallowunvalid');
}
- if (!trim($readmecontent)) {
- //$readmecontent.="";
- }
+ //if (!trim($readmecontent)) {
+ //$readmecontent.="";
+ //}
if (!GETPOSTISSET('WEBSITE_LICENSE')) {
$licensecontent = @file_get_contents($filelicense);
@@ -3894,9 +3894,9 @@ if ($action == 'editcss') {
} else {
$licensecontent = GETPOST('WEBSITE_LICENSE', 'restricthtmlallowunvalid');
}
- if (!trim($licensecontent)) {
- //$readmecontent.="";
- }
+ //if (!trim($licensecontent)) {
+ //$readmecontent.="";
+ //}
print dol_get_fiche_head();
@@ -3928,7 +3928,7 @@ if ($action == 'editcss') {
print $form->textwithpicto($langs->trans('MainLanguage'), $htmltext, 1, 'help', '', 0, 2, 'WEBSITE_LANG');
print '
';
} else {
+ // $answerrecord is not list of WebsitePage
+ '@phan-var-force array{type:string} $answerrecord';
$param = '?mode=replacesite';
$param .= '&websiteid='.$website->id;
$param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09');
diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php
index 10053cde001..c327bf1b475 100644
--- a/htdocs/website/lib/websiteaccount.lib.php
+++ b/htdocs/website/lib/websiteaccount.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
* Prepare array of tabs for SocieteAccount
*
* @param SocieteAccount $object SocieteAccount
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function websiteaccountPrepareHead($object)
{
diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php
index d5374d68a03..ba71e9386ad 100644
--- a/htdocs/workstation/class/workstation.class.php
+++ b/htdocs/workstation/class/workstation.class.php
@@ -887,6 +887,7 @@ class Workstation extends CommonObject
if (class_exists($classname)) {
$obj = new $classname();
+ '@phan-var-force ModeleNumRefWorkstation $obj';
$numref = $obj->getNextValue($this);
if ($numref != '' && $numref != '-1') {
@@ -909,13 +910,13 @@ class Workstation extends CommonObject
/**
* Create a document onto disk according to template module.
*
- * @param string $modele Force template to use ('' to not force)
- * @param Translate $outputlangs object lang a utiliser pour traduction
- * @param int $hidedetails Hide details of lines
- * @param int $hidedesc Hide description
- * @param int $hideref Hide ref
- * @param null|array $moreparams Array to provide more information
- * @return int 0 if KO, 1 if OK
+ * @param string $modele Force template to use ('' to not force)
+ * @param Translate $outputlangs object lang a utiliser pour traduction
+ * @param int $hidedetails Hide details of lines
+ * @param int $hidedesc Hide description
+ * @param int $hideref Hide ref
+ * @param ?array $moreparams Array to provide more information
+ * @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
diff --git a/htdocs/workstation/lib/workstation.lib.php b/htdocs/workstation/lib/workstation.lib.php
index 5cca71a1738..086093daaab 100644
--- a/htdocs/workstation/lib/workstation.lib.php
+++ b/htdocs/workstation/lib/workstation.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -25,7 +26,7 @@
/**
* Prepare admin pages header
*
- * @return array
+ * @return array Array of tabs to show
*/
function workstationAdminPrepareHead()
{
diff --git a/htdocs/workstation/lib/workstation_workstation.lib.php b/htdocs/workstation/lib/workstation_workstation.lib.php
index e044de7566d..f9500cb8324 100644
--- a/htdocs/workstation/lib/workstation_workstation.lib.php
+++ b/htdocs/workstation/lib/workstation_workstation.lib.php
@@ -1,6 +1,7 @@
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* 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
@@ -26,7 +27,7 @@
* Prepare array of tabs for Workstation
*
* @param Workstation $object Workstation
- * @return array Array of tabs
+ * @return array Array of tabs to show
*/
function workstationPrepareHead($object)
{
diff --git a/htdocs/zapier/lib/zapier.lib.php b/htdocs/zapier/lib/zapier.lib.php
index e04e048949d..20f6fed8bca 100644
--- a/htdocs/zapier/lib/zapier.lib.php
+++ b/htdocs/zapier/lib/zapier.lib.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 MDW
*
* 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
@@ -24,7 +25,7 @@
/**
* Prepare admin pages header
*
- * @return array Returns an array with list of tab entries
+ * @return array Array of tabs to show
*/
function zapierAdminPrepareHead()
{
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 294aff64943..0db3ae9a88a 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -118,6 +118,7 @@ parameters:
- '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#'
- '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#'
- '#colorHexToHsl expects float\|false, true#'
+ - '#Call to function array_key_exists.. with .error. .* will always evaluate to false.#'
- '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#'
- '#(?:make_substitutions expects array,) string given\.#'