From b7db15c700b272eb1e3d606e362ab3f99c848060 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 22 Oct 2024 11:42:28 +0200 Subject: [PATCH 1/8] Qual: Fix phan notices in class files (part 2) --- dev/tools/phan/baseline.txt | 11 ++- htdocs/comm/propal/class/propal.class.php | 10 +-- htdocs/commande/class/commande.class.php | 10 +-- htdocs/compta/facture/class/facture.class.php | 16 ++--- htdocs/core/class/commonorder.class.php | 23 ++++++- htdocs/core/class/ctypent.class.php | 7 ++ htdocs/core/class/ctyperesource.class.php | 7 +- htdocs/core/class/cunits.class.php | 41 +++++++---- htdocs/core/class/diasporahandler.class.php | 33 ++++----- htdocs/core/class/discount.class.php | 68 ++++++++++++++++++- .../fourn/class/fournisseur.facture.class.php | 8 +-- .../class/supplier_proposal.class.php | 8 +-- 12 files changed, 173 insertions(+), 69 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index c9506b8fe3917..167046fa78662 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -15,7 +15,7 @@ return [ // PhanTypeMismatchArgumentProbablyReal : 400+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences // PhanPluginUnknownArrayMethodReturnType : 290+ occurrences - // PhanPluginUnknownArrayMethodParamType : 220+ occurrences + // PhanPluginUnknownArrayMethodParamType : 210+ occurrences // PhanPossiblyUndeclaredVariable : 200+ occurrences // PhanTypeMismatchProperty : 170+ occurrences // PhanPluginUnknownArrayFunctionParamType : 95+ occurrences @@ -24,8 +24,8 @@ return [ // PhanPluginUnknownArrayFunctionReturnType : 50+ occurrences // PhanRedefineFunction : 50+ occurrences // PhanPluginEmptyStatementIf : 45+ occurrences - // PhanPluginUnknownArrayPropertyType : 40+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences + // PhanPluginUnknownArrayPropertyType : 35+ occurrences // PhanTypeInvalidDimOffset : 35+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences // PhanPluginUnknownObjectMethodCall : 15+ occurrences @@ -247,11 +247,8 @@ return [ 'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonsocialnetworks.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/conf.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'], - 'htdocs/core/class/ctypent.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/class/ctyperesource.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/class/cunits.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/class/diasporahandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/discount.class.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/cunits.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/doleditor.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/dolgeoip.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/core/class/dolgraph.class.php' => ['PhanUndeclaredProperty'], diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a39c207144c88..99ce09c9a9907 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -562,7 +562,7 @@ public function insert_discount($idremise) $line->desc = $remise->description; // Description ligne $line->vat_src_code = $remise->vat_src_code; $line->tva_tx = $remise->tva_tx; - $line->subprice = -$remise->amount_ht; + $line->subprice = -(float) $remise->amount_ht; $line->fk_product = 0; // Id produit predefined $line->qty = 1; $line->remise_percent = 0; @@ -570,11 +570,11 @@ public function insert_discount($idremise) $line->info_bits = 2; // TODO deprecated - $line->price = -$remise->amount_ht; + $line->price = -(float) $remise->amount_ht; - $line->total_ht = -$remise->amount_ht; - $line->total_tva = -$remise->amount_tva; - $line->total_ttc = -$remise->amount_ttc; + $line->total_ht = -(float) $remise->amount_ht; + $line->total_tva = -(float) $remise->amount_tva; + $line->total_ttc = -(float) $remise->amount_ttc; $result = $line->insert(); if ($result > 0) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 14b44008580b7..f0fae6c7c1746 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2056,17 +2056,17 @@ public function insert_discount($idremise) $line->desc = $remise->description; // Description ligne $line->vat_src_code = $remise->vat_src_code; $line->tva_tx = $remise->tva_tx; - $line->subprice = -$remise->amount_ht; - $line->price = -$remise->amount_ht; + $line->subprice = -(float) $remise->amount_ht; + $line->price = -(float) $remise->amount_ht; $line->fk_product = 0; // Id produit predefini $line->qty = 1; $line->remise_percent = 0; $line->rang = -1; $line->info_bits = 2; - $line->total_ht = -$remise->amount_ht; - $line->total_tva = -$remise->amount_tva; - $line->total_ttc = -$remise->amount_ttc; + $line->total_ht = -(float) $remise->amount_ht; + $line->total_tva = -(float) $remise->amount_tva; + $line->total_ttc = -(float) $remise->amount_ttc; $result = $line->insert(); if ($result > 0) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 748ca9a08c86d..e1384912b4d9c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2664,7 +2664,7 @@ public function insert_discount($idremise) $facligne->desc = $remise->description; // Description ligne $facligne->vat_src_code = $remise->vat_src_code; $facligne->tva_tx = $remise->tva_tx; - $facligne->subprice = -$remise->amount_ht; + $facligne->subprice = -(float) $remise->amount_ht; $facligne->fk_product = 0; // Id produit predefini $facligne->qty = 1; $facligne->remise_percent = 0; @@ -2689,14 +2689,14 @@ public function insert_discount($idremise) $facligne->pa_ht = $arraytmp['pa_total']; } - $facligne->total_ht = -$remise->amount_ht; - $facligne->total_tva = -$remise->amount_tva; - $facligne->total_ttc = -$remise->amount_ttc; + $facligne->total_ht = -(float) $remise->amount_ht; + $facligne->total_tva = -(float) $remise->amount_tva; + $facligne->total_ttc = -(float) $remise->amount_ttc; - $facligne->multicurrency_subprice = -$remise->multicurrency_subprice; - $facligne->multicurrency_total_ht = -$remise->multicurrency_amount_ht; - $facligne->multicurrency_total_tva = -$remise->multicurrency_amount_tva; - $facligne->multicurrency_total_ttc = -$remise->multicurrency_amount_ttc; + $facligne->multicurrency_subprice = -(float) $remise->multicurrency_subprice; + $facligne->multicurrency_total_ht = -(float) $remise->multicurrency_amount_ht; + $facligne->multicurrency_total_tva = -(float) $remise->multicurrency_amount_tva; + $facligne->multicurrency_total_ttc = -(float) $remise->multicurrency_amount_ttc; $lineid = $facligne->insert(); if ($lineid > 0) { diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 0f82d2a5fe480..f7c59dc82773e 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -110,14 +110,15 @@ abstract class CommonOrderLine extends CommonObjectLine { /** * Custom label of line. Not used by default. - * @deprecated + * @deprecated Use $product_label + * @var string */ public $label; /** * Product ref * @var string - * @deprecated Use product_ref + * @deprecated Use $product_ref * @see $product_ref */ public $ref; @@ -249,10 +250,28 @@ abstract class CommonOrderLine extends CommonObjectLine */ public $special_code = 0; + /** + * @var int + */ 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; } diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index 26c5e07b2cfc6..ef4f927b0b006 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.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 @@ -35,7 +36,13 @@ class Ctypent extends CommonDict */ public $country_id; + /** + * @var string + */ public $libelle; + /** + * @var string + */ public $module; /** diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index 076b71983538e..a050d72e4b7ae 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -199,7 +199,7 @@ public function fetch($id, $code = '', $label = '') * @param string $sortfield Sort field * @param int $limit Limit * @param int $offset Offset limit - * @param string|array $filter filter array + * @param string|array $filter Filter array * @param string $filtermode filter mode (AND or OR) * @return int Return integer <0 if KO, >0 if OK */ @@ -473,7 +473,7 @@ class CtyperesourceLine public $id; /** - * @var mixed Sample line property 1 + * @var string Sample line property 1 */ public $code; @@ -482,5 +482,8 @@ class CtyperesourceLine */ public $label; + /** + * @var int + */ public $active; } diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 2ea5a74f530c8..b55457159d561 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -31,6 +31,9 @@ */ class CUnits extends CommonDict { + /** + * @var CUnits[] + */ public $records = array(); //var $element='ctypent'; //!< Id that identify managed objects @@ -38,14 +41,26 @@ class CUnits extends CommonDict /** * @var string label - * @deprecated + * @deprecated Use $label * @see $label */ public $libelle; + /** + * @var string + */ public $sortorder; + /** + * @var string + */ public $short_label; + /** + * @var string + */ public $unit_type; + /** + * @var string + */ public $scale; @@ -63,9 +78,9 @@ public function __construct($db) /** * Create object into database * - * @param User $user User that create - * @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 create + * @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, $notrigger = 0) { @@ -212,9 +227,9 @@ public function fetch($id, $code = '', $short_label = '', $unit_type = '') * @param string $sortfield Sort field * @param int $limit Limit * @param int $offset Offset - * @param string|array $filter Filter USF + * @param string|array $filter Filter USF * @param string $filtermode Filter mode (AND or OR) - * @return array|int int <0 if KO, array of pages if OK + * @return CUnits[]|int int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { @@ -306,9 +321,9 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = /** * Update object into database * - * @param User $user User that modify - * @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 modify + * @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 = null, $notrigger = 0) { @@ -378,8 +393,8 @@ public function update($user = null, $notrigger = 0) /** * Delete object in database * - * @param User $user User that delete - * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @param User $user User that delete + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ public function delete($user, $notrigger = 0) @@ -430,10 +445,10 @@ public function getUnitFromCode($code, $mode = 'code', $unit_type = '') /** * Unit converter - * @param double $value value to convert + * @param float $value value to convert * @param int $fk_unit current unit id of value * @param int $fk_new_unit the id of unit to convert in - * @return double + * @return float */ public function unitConverter($value, $fk_unit, $fk_new_unit = 0) { diff --git a/htdocs/core/class/diasporahandler.class.php b/htdocs/core/class/diasporahandler.class.php index b309228c6c571..de93ab4789032 100644 --- a/htdocs/core/class/diasporahandler.class.php +++ b/htdocs/core/class/diasporahandler.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 @@ -23,13 +24,13 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/socialnetworkmanager.class.php'; - /** - * Class for handling Diaspora API interactions - */ +/** +* Class for handling Diaspora API interactions +*/ class DiasporaHandler { /** - * @var array Posts fetched from the API + * @var array Posts fetched from the API */ private $posts = []; @@ -38,15 +39,15 @@ class DiasporaHandler */ public $error = ''; - /** - * @var array Authentication parameters, including cookie name and value - */ + /** + * @var array Authentication parameters, including cookie name and value + */ private $params = []; - /** - * Check if the provided cookie in params is valid. - * @return bool True if a valid cookie is found in params, false otherwise. - */ + /** + * Check if the provided cookie in params is valid. + * @return bool True if a valid cookie is found in params, false otherwise. + */ private function isCookieValid() { return !empty($this->getCookieFromParams()); @@ -54,7 +55,7 @@ private function isCookieValid() /** * Get the cookie value from params, regardless of the exact key name. - * @return string|null The cookie string if found, null otherwise. + * @return ?string The cookie string if found, null otherwise. */ private function getCookieFromParams() { @@ -73,7 +74,7 @@ private function getCookieFromParams() * @param int $maxNb Maximum number of posts to retrieve (default is 5). * @param int $cacheDelay Number of seconds to use cached data (0 to disable caching). * @param string $cacheDir Directory to store cached data. - * @param array $authParams Authentication parameters including login URL, username, and password. + * @param array $authParams Authentication parameters including login URL, username, and password. * @return bool Status code: False if error, true if success. */ public function fetch($urlAPI, $maxNb = 5, $cacheDelay = 60, $cacheDir = '', $authParams = []) @@ -146,8 +147,8 @@ public function fetch($urlAPI, $maxNb = 5, $cacheDelay = 60, $cacheDir = '', $au /** * Normalize data of retrieved posts. * - * @param array $postData Data of a single post. - * @return array Normalized post data. + * @param array $postData Data of a single post. + * @return array{}|array{id:string,content:string,created_at:string,url:string,author_name:string,author_avatar:string} Normalized post data. */ public function normalizeData($postData) { @@ -179,7 +180,7 @@ private function formatDate($dateString) /** * Get the list of retrieved posts. * - * @return array List of posts. + * @return array Posts fetched from the API List of posts. */ public function getPosts() { diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 6d83cb7183d1a..3b267092dd0a6 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -48,22 +48,64 @@ class DiscountAbsolute extends CommonObject */ public $discount_type; // 0 => customer discount, 1 => supplier discount + /** + * @var float + */ public $total_ht; + /** + * @var float + */ public $total_tva; + /** + * @var float + */ public $total_ttc; + /** + * @var string|float + * @deprecated + */ public $amount_ht; // deprecated + /** + * @var string|float + * @deprecated + */ public $amount_tva; // deprecated + /** + * @var string|float + * @deprecated + */ public $amount_ttc; // deprecated + /** + * @var float + */ public $multicurrency_total_ht; + /** + * @var float + */ public $multicurrency_total_tva; + /** + * @var float + */ public $multicurrency_total_ttc; + /** + * @var string|float + * @deprecated + */ public $multicurrency_amount_ht; // deprecated + /** + * @var string|float + * @deprecated + */ public $multicurrency_amount_tva; // deprecated + /** + * @var string|float + * @deprecated + */ public $multicurrency_amount_ttc; // deprecated /** - * @var double + * @var float */ public $multicurrency_subprice; @@ -77,8 +119,13 @@ class DiscountAbsolute extends CommonObject */ public $fk_invoice_supplier_line; - // Vat rate + /** + * @var string|float Vat rate + */ public $tva_tx; + /** + * @var string + */ public $vat_src_code; /** @@ -94,7 +141,7 @@ class DiscountAbsolute extends CommonObject /** * Date creation record (datec) * - * @var integer + * @var int */ public $datec; @@ -112,11 +159,26 @@ class DiscountAbsolute extends CommonObject * @var int ID credit note or deposit used to create the discount */ public $fk_facture_source; + /** + * @var string + */ public $ref_facture_source; // Ref credit note or deposit used to create the discount + /** + * @var int + */ public $type_facture_source; + /** + * @var int + */ public $fk_invoice_supplier_source; + /** + * @var string + */ public $ref_invoice_supplier_source; // Ref credit note or deposit used to create the discount + /** + * @var int + */ public $type_invoice_supplier_source; /** diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index dbc823be1ffc4..d699dcddd1dc1 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1361,7 +1361,7 @@ public function insert_discount($idremise) $facligne->desc = $remise->description; // Description ligne $facligne->vat_src_code = $remise->vat_src_code; $facligne->tva_tx = $remise->tva_tx; - $facligne->subprice = -$remise->amount_ht; + $facligne->subprice = -(float) $remise->amount_ht; $facligne->fk_product = 0; // Id produit predefini $facligne->product_type = 0; $facligne->qty = 1; @@ -1388,9 +1388,9 @@ public function insert_discount($idremise) $facligne->pa_ht = $arraytmp['pa_total']; } - $facligne->total_ht = -$remise->amount_ht; - $facligne->total_tva = -$remise->amount_tva; - $facligne->total_ttc = -$remise->amount_ttc; + $facligne->total_ht = -(float) $remise->amount_ht; + $facligne->total_tva = -(float) $remise->amount_tva; + $facligne->total_ttc = -(float) $remise->amount_ttc; $facligne->multicurrency_subprice = -$remise->multicurrency_subprice; $facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 1424f305489e5..767c31d57b604 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -372,16 +372,16 @@ public function insert_discount($idremise) $supplier_proposalligne->fk_remise_except = $remise->id; $supplier_proposalligne->desc = $remise->description; // Description ligne $supplier_proposalligne->tva_tx = $remise->tva_tx; - $supplier_proposalligne->subprice = -$remise->amount_ht; + $supplier_proposalligne->subprice = -(float) $remise->amount_ht; $supplier_proposalligne->fk_product = 0; // Id produit predefini $supplier_proposalligne->qty = 1; $supplier_proposalligne->remise_percent = 0; $supplier_proposalligne->rang = -1; $supplier_proposalligne->info_bits = 2; - $supplier_proposalligne->total_ht = -$remise->amount_ht; - $supplier_proposalligne->total_tva = -$remise->amount_tva; - $supplier_proposalligne->total_ttc = -$remise->amount_ttc; + $supplier_proposalligne->total_ht = -(float) $remise->amount_ht; + $supplier_proposalligne->total_tva = -(float) $remise->amount_tva; + $supplier_proposalligne->total_ttc = -(float) $remise->amount_ttc; $result = $supplier_proposalligne->insert(); if ($result > 0) { From d5ba1864d9ee90e2b2cdcd03b25b9e16694a0754 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 22 Oct 2024 16:50:14 +0200 Subject: [PATCH 2/8] Qual: Fix phan notices doleditor...events.class --- dev/tools/phan/baseline.txt | 11 +--- htdocs/core/class/doleditor.class.php | 60 ++++++++++++++++--- htdocs/core/class/dolgeoip.class.php | 5 +- htdocs/core/class/dolreceiptprinter.class.php | 15 +++-- .../core/class/emailsenderprofile.class.php | 18 ++++++ htdocs/core/class/evalmath.class.php | 49 +++++++++++---- htdocs/core/class/events.class.php | 40 +++++++------ phpstan.neon.dist | 2 - 8 files changed, 146 insertions(+), 54 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 167046fa78662..f92f57961d867 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -14,10 +14,10 @@ return [ // PhanPossiblyUndeclaredGlobalVariable : 580+ occurrences // PhanTypeMismatchArgumentProbablyReal : 400+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 290+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 280+ occurrences // PhanPluginUnknownArrayMethodParamType : 210+ occurrences // PhanPossiblyUndeclaredVariable : 200+ occurrences - // PhanTypeMismatchProperty : 170+ occurrences + // PhanTypeMismatchProperty : 160+ occurrences // PhanPluginUnknownArrayFunctionParamType : 95+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences // PhanTypeMismatchArgumentNullableInternal : 65+ occurrences @@ -249,13 +249,8 @@ return [ 'htdocs/core/class/conf.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'], 'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/cunits.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/class/doleditor.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/class/dolgeoip.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/core/class/dolgraph.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/dolreceiptprinter.class.php' => ['PhanEmptyForeach', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/class/emailsenderprofile.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/class/evalmath.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/class/events.class.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/core/class/emailsenderprofile.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/extrafields.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/core/class/extralanguages.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/fediverseparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 94eef750223cc..8d287b33a81dc 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -31,23 +31,65 @@ */ class DolEditor { + /** + * @var string + */ public $tool; // Store the selected tool // If using fckeditor + /** + * @var Object - Note: seems to be unused + */ public $editor; // If not using fckeditor + /** + * @var string + */ public $content; + /** + * @var string + */ public $htmlname; + /** + * @var string + */ public $toolbarname; + /** + * @var bool + */ public $toolbarstartexpanded; + /** + * @var int + */ public $rows; + /** + * @var string + */ public $cols; + /** + * @var int + */ public $height; + /** + * @var string + */ public $width; + /** + * @var int<0,1>|bool + */ public $uselocalbrowser; + /** + * @var int<0,1> + */ public $readonly; + /** + * @var int + */ public $posx; + /** + * @var int + */ public $posy; @@ -60,14 +102,14 @@ class DolEditor * @param int $height Height in pixel of edit area (200px by default) * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly'). * @param string $toolbarlocation Deprecated. Not used - * @param boolean $toolbarstartexpanded Bar is visible or not at start - * @param boolean|int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. - * @param boolean|int|string $okforextendededitor 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. + * @param bool $toolbarstartexpanded Bar is visible or not at start + * @param bool|int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. + * @param bool|int|string $okforextendededitor 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". * @param int $rows Size of rows for textarea tool * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') - * @param int $readonly 0=Read/Edit, 1=Read only - * @param array $poscursor Array for initial cursor position array('x'=>x, 'y'=>y). + * @param int<0,1> $readonly 0=Read/Edit, 1=Read only + * @param array{x?:string,y?:string,find?:string} $poscursor Array for initial cursor position array('x'=>x, 'y'=>y). * array('find'=> 'word') can be used to go to line were the word has been found */ public function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = 1, $okforextendededitor = true, $rows = 0, $cols = '', $readonly = 0, $poscursor = array()) @@ -102,7 +144,7 @@ public function __construct($htmlname, $content, $width = '', $height = 200, $to $this->tool = 'textarea'; } - if ( isset($poscursor['find']) ) { + if (isset($poscursor['find'])) { $posy = 0; $lines = explode("\n", $content); $nblines = count($lines); @@ -112,7 +154,9 @@ public function __construct($htmlname, $content, $width = '', $height = 200, $to break; } } - if ($posy != 0 ) $poscursor['y'] = $posy; + if ($posy != 0) { + $poscursor['y'] = $posy; + } } // Define some properties @@ -230,7 +274,7 @@ public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $ toolbar: \''.dol_escape_js($this->toolbarname).'\', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', width: '.($this->width ? '\''.dol_escape_js($this->width).'\'' : '\'\'').', - height: '.dol_escape_js($this->height).', + height: '.dol_escape_js((string) $this->height).', skin: \''.dol_escape_js($skin).'\', '.$scaytautostartup.' language: \''.dol_escape_js($langs->defaultlang).'\', diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 9ab52db0b86db..26d24a0dfb856 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.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 @@ -35,7 +36,7 @@ class DolGeoIP { /** - * @var GeoIp2\Database\Reader|string + * @var \GeoIp2\Database\Reader|\GeoIP|string */ public $gi; @@ -52,7 +53,7 @@ class DolGeoIP /** * Constructor * - * @param string $type 'country' or 'city' + * @param 'country'|'city' $type 'country' or 'city' * @param string $datfile Data file */ public function __construct($type, $datfile) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 8c69f9c018f45..746d99488e5ea 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -140,6 +140,9 @@ class dolReceiptPrinter extends Printer * @var \Mike42\Escpos\Printer */ public $printer; + /** + * @var string + */ public $template; /** @@ -150,13 +153,13 @@ class dolReceiptPrinter extends Printer /** * Array with list of printers - * @var array List of printers + * @var array List of printers */ public $listprinters; /** * Array with list of printer templates - * @var array List of printer templates + * @var array List of printer templates */ public $listprinterstemplates; @@ -379,7 +382,7 @@ public function listPrintersTemplates() $this->errors[] = $this->db->lasterror; } - $this->listprinterstemplates = $listofprinters; + $this->listprinterstemplates = $listofprinters; // @phpstan-ignore-line return $error; } @@ -772,7 +775,11 @@ public function sendToPrinter($object, $templateid, $printerid) //var_dump($object); $vatarray = array(); foreach ($object->lines as $line) { - $vatarray[$line->tva_tx] += $line->total_tva; + $vat_rate = $line->tva_tx; + if (!array_key_exists($vat_rate, $vatarray)) { + $vatarray[$vat_rate] = 0; + } + $vatarray[$vat_rate] += $line->total_tva; } foreach ($vatarray as $vatkey => $vatvalue) { $spacestoadd = $nbcharactbyline - strlen($vatkey) - 12; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 97276335625ed..5d98275fa21a6 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -50,6 +50,9 @@ class EmailSenderProfile extends CommonObject */ public $picto = 'emailsenderprofile'; + /** + * @var int + */ public $fk_user_creat; @@ -114,11 +117,26 @@ class EmailSenderProfile extends CommonObject */ public $label; + /** + * @var string + */ public $email; + /** + * @var int + */ public $private; + /** + * @var string + */ public $signature; + /** + * @var int + */ public $position; + /** + * @var int + */ public $active; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index 3b001c6267112..4879faf93f014 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -56,6 +56,11 @@ * * AUTHOR INFORMATION * Copyright 2005, Miles Kaufmann. + * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * LICENSE * Redistribution and use in source and binary forms, with or without @@ -95,22 +100,40 @@ */ class EvalMath { + /** + * @var bool + */ public $suppress_errors = false; + /** + * @var ?string + */ public $last_error = null; + /** + * @var ?array{0:int,1:null|string|array{0:?mixed,1:int}} + */ public $last_error_code = null; + /** + * @var array variables (and constants) + */ public $v = array('e' => 2.71, 'pi' => 3.14159); - // variables (and constants) + /** + * @var array}> user-defined functions + */ public $f = array(); - // user-defined functions + /** + * @var string[] constants + */ public $vb = array('e', 'pi'); - // constants - public $fb = array( // built-in functions + /** + * @var string[] built-in functions + */ + public $fb = array( 'sin', 'sinh', 'arcsin', 'asin', 'arcsinh', 'asinh', 'cos', 'cosh', 'arccos', 'acos', 'arccosh', 'acosh', 'tan', 'tanh', 'arctan', 'atan', 'arctanh', 'atanh', 'sqrt', 'abs', 'ln', 'log', 'intval', 'ceil', ); @@ -198,7 +221,7 @@ public function evaluate($expr) /** * Function vars * - * @return array Output + * @return array Output */ public function vars() { @@ -211,7 +234,7 @@ public function vars() /** * Function funcs * - * @return array Output + * @return string[] Output */ private function funcs() // @phpstan-ignore-line { @@ -228,7 +251,7 @@ private function funcs() // @phpstan-ignore-line * Convert infix to postfix notation * * @param string $expr Expression - * @return boolean|array Output + * @return boolean|array Output */ private function nfx($expr) { @@ -372,9 +395,9 @@ private function nfx($expr) /** * Evaluate postfix notation * - * @param array $tokens Expression - * @param array $vars Array - * @return string|false Output or false if error + * @param string[] $tokens Expression + * @param array $vars Array + * @return string|false Output or false if error */ private function pfx($tokens, $vars = array()) { @@ -459,9 +482,9 @@ private function pfx($tokens, $vars = array()) /** * trigger an error, but nicely, if need be * - * @param string $code Code - * @param string $msg Msg - * @param string|null $info String + * @param int $code Code + * @param string $msg Msg + * @param null|string|array{0:?mixed,1:int} $info String * @return false */ public function trigger($code, $msg, $info = null) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index a5dc47bb64c8f..3331cceedfa56 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2023 William Mead * 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 @@ -70,6 +71,9 @@ class Events // extends CommonObject */ public $entity; + /** + * @var int|string + */ public $dateevent; /** @@ -103,31 +107,33 @@ class Events // extends CommonObject public $authentication_method; - // List of all Audit/Security events supported by triggers + /** + * @var array}> List of all Audit/Security events supported by triggers + */ public $eventstolog = array( - array('id'=>'USER_LOGIN', 'test'=>1), - array('id'=>'USER_LOGIN_FAILED', 'test'=>1), - array('id'=>'USER_LOGOUT', 'test'=>1), - array('id'=>'USER_CREATE', 'test'=>1), - array('id'=>'USER_MODIFY', 'test'=>1), - array('id'=>'USER_NEW_PASSWORD', 'test'=>1), - array('id'=>'USER_ENABLEDISABLE', 'test'=>1), - array('id'=>'USER_DELETE', 'test'=>1), - array('id'=>'USERGROUP_CREATE', 'test'=>1), - array('id'=>'USERGROUP_MODIFY', 'test'=>1), - array('id'=>'USERGROUP_DELETE', 'test'=>1), + array('id' => 'USER_LOGIN', 'test' => 1), + array('id' => 'USER_LOGIN_FAILED', 'test' => 1), + array('id' => 'USER_LOGOUT', 'test' => 1), + array('id' => 'USER_CREATE', 'test' => 1), + array('id' => 'USER_MODIFY', 'test' => 1), + array('id' => 'USER_NEW_PASSWORD', 'test' => 1), + array('id' => 'USER_ENABLEDISABLE', 'test' => 1), + array('id' => 'USER_DELETE', 'test' => 1), + array('id' => 'USERGROUP_CREATE', 'test' => 1), + array('id' => 'USERGROUP_MODIFY', 'test' => 1), + array('id' => 'USERGROUP_DELETE', 'test' => 1), ); // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20), - 'prefix_session'=>array('type'=>'varchar(255)', 'label'=>'PrefixSession', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'user_agent' =>array('type'=>'varchar(255)', 'label'=>'UserAgent', 'enabled'=>1, 'visible'=>-1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => '1', 'index' => 1, 'position' => 20), + 'prefix_session' => array('type' => 'varchar(255)', 'label' => 'PrefixSession', 'enabled' => 1, 'visible' => -1, 'notnull' => -1, 'index' => 0, 'position' => 1000), + 'user_agent' => array('type' => 'varchar(255)', 'label' => 'UserAgent', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), ); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index b186ce6cfdd26..2b99e8e63cc72 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -80,7 +80,6 @@ parameters: - '#(?:colorAdjustBrightness|imap_(?:(?:fetch)?body|fetchstructure)) expects int, string#' - '#(?:(?:(?:BonPrelevement::generat|CommonObject::update_pric)e|Form(?:::getSelectConditionsPaiements|Company::select_state)|In(?:foBox::listBoxes|tracommReport::addItemsFact)|Menubase::recur|Ticket::sendTicketMessageByEmail|mod_barcode_(?:(?:product|thirdparty)_standard::literalBarcodeType))\(\)) expects int, string given\.#' - '#on array{url: mixed} in empty\(\) does not exist.#' - - '#EvalMath::trigger\(\) expects string, int given#' - '# Diff::generatePartialDiff\(\) expects array#' - '# EmailCollector::getpart\(\) expects string#' - '#(?:(?:CommonStickerGenerator::_Croix|pdf_(?:azur::_tableau_(?:info|tot)|ban::_tableau))\(\)|pdf_(?:bank|c(?:anelle::_tableau_(?:(?:tot|versements)\(\))|ornas::_tableau_(?:(?:info|tot)\(\))|rabe::_tableau_(?:(?:info|tot|versements)\(\))|yan::draw(?:(?:Info|Total)Table\(\)))|e(?:agle(?:(?:::_tableau_tot|_proforma::drawTotalTable)\(\))|instein::_tableau_(?:(?:info|tot)\(\))|ratosthene::draw(?:(?:Info|Total)Table\(\))|spadon::_tableau_tot\(\))|muscadet::_tableau_(?:(?:info|tot)\(\))|octopus::(?:_table(?:(?:FirstPage|au)\(\))|draw(?:(?:Info|Total)Table\(\)))|page(?:foot|head)|(?:rouget::_tableau_tot|s(?:epamandate::_tableau(?:_info)?|ponge::draw(?:(?:Info|Total)Table)|quille::_tableau_tot|t(?:andard_(?:e(?:(?:valuation|xpensereport)::_tableau|xpensereport::tablePayments)|(?:myobjec|supplierpaymen)t::_tableau|supplierpayment::_tableau_cheque)|orm::_tableau_info|rato::tabSignature))|t(?:cpdflabel::writeBarcode|yphon::_tableau_info)|vinci::_tableau_info)\(\)|w(?:atermark|rite(?:LinkedObjects|linedesc))|zenith::_tableau_tot\(\))) expects int, float given\.#' @@ -88,7 +87,6 @@ parameters: - '#(?:dol_(?:mktime|remove_file_process)|print_actions_filter) expects int, array\|string given\.#' - '# (CSMSFile) constructor expects int, array\|string given.#' - '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#' - - '#EvalMath::trigger\(\) expects string\|null,#' - '#(?:F(?:acture(?:(?:Fournisseur)?Rec::addline\(\))|ichinterRec::addLineRec\(\))|dolMd2Html) expects string\|null,#' - '#::printStdColumnContent\(\) expects string, float(\|(int|array)(\<.*\>)?)* given.#' - '#::HTML2OpenIDServer\(\) expects string, array given.#' From b547d4d9916f2c00f0a205396791aac05d36e8e5 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 23 Oct 2024 01:37:18 +0200 Subject: [PATCH 3/8] Qual: Fix phan notices defaultvalues...formprojet.class --- dev/tools/phan/baseline.txt | 68 ++++------ htdocs/admin/barcode.php | 2 +- htdocs/admin/defaultvalues.php | 41 +++--- htdocs/categories/photos.php | 3 +- .../facture/class/factureligne.class.php | 6 +- htdocs/core/ajax/ajaxdirpreview.php | 2 +- htdocs/core/class/defaultvalues.class.php | 4 +- htdocs/core/class/diasporahandler.class.php | 4 +- htdocs/core/class/dolreceiptprinter.class.php | 2 +- htdocs/core/class/extrafields.class.php | 122 +++++++++--------- htdocs/core/class/extralanguages.class.php | 4 +- htdocs/core/class/fediverseparser.class.php | 5 +- htdocs/core/class/fileupload.class.php | 22 +++- htdocs/core/class/fiscalyear.class.php | 10 +- htdocs/core/class/html.form.class.php | 45 +++---- .../core/class/html.formaccounting.class.php | 1 + htdocs/core/class/html.formadmin.class.php | 1 - htdocs/core/class/html.formbarcode.class.php | 3 +- htdocs/core/class/html.formcategory.class.php | 11 +- htdocs/core/class/html.formfile.class.php | 33 ++--- htdocs/core/class/html.formldap.class.php | 5 +- htdocs/core/class/html.formmargin.class.php | 15 ++- htdocs/core/class/html.formprojet.class.php | 8 +- htdocs/core/class/mastodonhandler.class.php | 2 +- htdocs/core/class/reddithandler.class.php | 5 +- .../core/class/socialnetworkmanager.class.php | 2 +- htdocs/ecm/search.php | 37 +++--- 27 files changed, 236 insertions(+), 227 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index f92f57961d867..8344f9882a183 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -15,12 +15,12 @@ return [ // PhanTypeMismatchArgumentProbablyReal : 400+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences // PhanPluginUnknownArrayMethodReturnType : 280+ occurrences - // PhanPluginUnknownArrayMethodParamType : 210+ occurrences - // PhanPossiblyUndeclaredVariable : 200+ occurrences + // PhanPluginUnknownArrayMethodParamType : 190+ occurrences + // PhanPossiblyUndeclaredVariable : 190+ occurrences // PhanTypeMismatchProperty : 160+ occurrences // PhanPluginUnknownArrayFunctionParamType : 95+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 65+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 60+ occurrences // PhanPluginUnknownArrayFunctionReturnType : 50+ occurrences // PhanRedefineFunction : 50+ occurrences // PhanPluginEmptyStatementIf : 45+ occurrences @@ -39,8 +39,9 @@ return [ // PhanUndeclaredMethod : 10+ occurrences // PhanPluginSuspiciousParamPosition : 9 occurrences // PhanPluginBothLiteralsBinaryOp : 8 occurrences + // PhanPluginConstantVariableNull : 8 occurrences + // PhanPossiblyNullTypeMismatchProperty : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences - // PhanPossiblyNullTypeMismatchProperty : 7 occurrences // PhanParamTooMany : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences @@ -55,6 +56,9 @@ return [ 'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'], 'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/adherents/type.php' => ['PhanTypeMismatchProperty'], + 'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/admin/defaultvalues.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], @@ -91,11 +95,11 @@ return [ 'htdocs/categories/edit.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/index.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/info.php' => ['PhanTypeMismatchDimFetch'], - 'htdocs/categories/photos.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch'], + 'htdocs/categories/photos.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/traduction.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], 'htdocs/collab/index.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'], - 'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanTypeMismatchProperty'], 'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/comm/action/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -139,7 +143,7 @@ return [ 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginEmptyStatementIf'], - 'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'], + 'htdocs/compta/facture/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'], @@ -149,7 +153,7 @@ return [ 'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/prelevement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], + 'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/journal/purchasesjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/journal/sellsjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -192,7 +196,7 @@ return [ 'htdocs/compta/tva/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], - 'htdocs/contact/card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/contact/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contact/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contact/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'], @@ -201,9 +205,7 @@ return [ 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/contrat/messaging.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contrat/services_list.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contrat/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], - 'htdocs/core/actions_builddoc.inc.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/actions_comments.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/actions_extrafields.inc.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/actions_lineupdown.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -214,7 +216,6 @@ return [ 'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/ajax/fileupload.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/ajax/onlineSign.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/ajax/selectsearchbox.php' => ['PhanPluginUndeclaredVariableIsset'], @@ -242,7 +243,7 @@ return [ 'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonhookactions.class.php' => ['PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'], + 'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/class/commonorder.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonsocialnetworks.class.php' => ['PhanUndeclaredProperty'], @@ -251,28 +252,17 @@ return [ 'htdocs/core/class/cunits.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/dolgraph.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/emailsenderprofile.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/extrafields.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/core/class/extralanguages.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/fediverseparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/class/fileupload.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'], - 'htdocs/core/class/fiscalyear.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/hookmanager.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.formaccounting.class.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/class/html.formbarcode.class.php' => ['PhanPluginUnknownArrayMethodParamType'], - 'htdocs/core/class/html.formcategory.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.formfile.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/class/html.formldap.class.php' => ['PhanPluginUnknownArrayMethodParamType'], + 'htdocs/core/class/html.formfile.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.formmargin.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ldap.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/link.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/openid.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/class/reddithandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], + 'htdocs/core/class/reddithandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/class/smtps.class.php' => ['PhanTypeConversionFromArray'], 'htdocs/core/class/socialnetworkmanager.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/stats.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'], @@ -403,10 +393,9 @@ return [ 'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/list_print_total.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/notes.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/objectline_title.tpl.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/tpl/notes.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/onlinepaymentlinks.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'], @@ -440,7 +429,7 @@ return [ 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/document.php' => ['PhanRedefineFunction'], 'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'], - 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], 'htdocs/don/class/paymentdonation.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -452,7 +441,7 @@ return [ 'htdocs/don/paiement/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/payment/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/don/tpl/linkedobjectblock.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/don/tpl/linkedobjectblock.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/ecm/class/ecmfiles.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/ecm/class/htmlecm.form.class.php' => ['PhanPluginUnknownArrayMethodParamType'], @@ -480,7 +469,6 @@ return [ 'htdocs/expedition/list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/expedition/note.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expedition/shipment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -512,7 +500,6 @@ return [ 'htdocs/fourn/commande/info.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/commande/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/commande/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/fourn/contact.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/facture/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fourn/facture/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], @@ -524,7 +511,7 @@ return [ 'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/holiday/view_log.php' => ['PhanTypeMismatchDimFetch'], @@ -695,7 +682,7 @@ return [ 'htdocs/public/payment/paymentko.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/project/index.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/project/new.php' => ['PhanRedefineFunction', 'PhanUndeclaredProperty'], + 'htdocs/public/project/new.php' => ['PhanRedefineFunction'], 'htdocs/public/project/suggestbooth.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/public/project/suggestconference.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], @@ -717,7 +704,6 @@ return [ 'htdocs/reception/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/reception/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/reception/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach'], 'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], @@ -736,7 +722,6 @@ return [ 'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/resource/class/html.formresource.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeExpectedObjectPropAccess'], - 'htdocs/resource/element_resource.php' => ['PhanUndeclaredProperty'], 'htdocs/salaries/admin/salaries.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -767,16 +752,14 @@ return [ 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/support/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'], 'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/takepos/public/menu.php' => ['PhanUndeclaredProperty'], 'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'], 'htdocs/theme/eldy/btn.inc.php' => ['PhanUndeclaredGlobalVariable'], @@ -799,7 +782,6 @@ return [ 'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'], - 'htdocs/ticket/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/user/bank.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/user/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/user/class/api_users.class.php' => ['PhanTypeMismatchProperty'], diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index c32c4af437660..344d635c4b2c2 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -192,7 +192,7 @@ } } } -'@phan-var-force array $barcodelist'; +'@phan-var-force array $barcodelist'; // Select barcode numbering module diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index ff93e3f229a88..988feac4c0817 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -1,6 +1,7 @@ * Copyright (C) 2017-2018 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 @@ -141,13 +142,13 @@ if (!$error) { if ($action == 'add' || (GETPOST('add') && $action != 'update')) { - $object->type=$mode; - $object->user_id=0; - $object->page=$defaulturl; - $object->param=$defaultkey; - $object->value=$defaultvalue; - $object->entity=$conf->entity; - $result=$object->create($user); + $object->type = $mode; + $object->user_id = 0; + $object->page = $defaulturl; + $object->param = $defaultkey; + $object->value = $defaultvalue; + $object->entity = $conf->entity; + $result = $object->create($user); if ($result < 0) { $action = ''; setEventMessages($object->error, $object->errors, 'errors'); @@ -160,14 +161,14 @@ } } if (GETPOST('actionmodify')) { - $object->id=$id; - $object->type=$mode; - $object->page=$urlpage; - $object->param=$key; - $object->value=$value; - $object->entity=$conf->entity; - $result=$object->update($user); - if ($result<0) { + $object->id = $id; + $object->type = $mode; + $object->page = $urlpage; + $object->param = $key; + $object->value = $value; + $object->entity = $conf->entity; + $result = $object->update($user); + if ($result < 0) { $action = ''; setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -183,9 +184,9 @@ // Delete line from delete picto if ($action == 'delete') { - $object->id=$id; - $result=$object->delete($user); - if ($result<0) { + $object->id = $id; + $result = $object->delete($user); + if ($result < 0) { $action = ''; setEventMessages($object->error, $object->errors, 'errors'); } @@ -356,7 +357,7 @@ print ''."\n"; print ''."\n"; -$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode, 't.entity'=>array($user->entity,$conf->entity))); +$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type' => $mode, 't.entity' => array($user->entity,$conf->entity))); if (!is_array($result) && $result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -396,7 +397,7 @@ // Multicompany print ''; if (isModEnabled('multicompany')) { - print dol_escape_htmltag($defaultvalue->entity); + print dol_escape_htmltag((string) $defaultvalue->entity); } print ''; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 67007b7dad399..da93b74bb1776 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -6,6 +6,7 @@ * Copyright (C) 2014 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * 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 @@ -193,7 +194,7 @@ if ($action == 'ajout_photo' && $user->hasRight('categorie', 'creer') && getDolGlobalString('MAIN_UPLOAD_DOC')) { // Affiche formulaire upload $formfile = new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type, $langs->trans("AddPhoto"), 1, '', $user->hasRight('categorie', 'creer'), 50, $object, '', false, '', 0); + $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type, $langs->trans("AddPhoto"), 1, 0, $user->hasRight('categorie', 'creer'), 50, $object, '', false, '', 0); } // Affiche photos diff --git a/htdocs/compta/facture/class/factureligne.class.php b/htdocs/compta/facture/class/factureligne.class.php index f4191f693ba5f..356c1ab382d02 100644 --- a/htdocs/compta/facture/class/factureligne.class.php +++ b/htdocs/compta/facture/class/factureligne.class.php @@ -291,9 +291,9 @@ public function fetch($rowid) /** * Insert line into database * - * @param int $notrigger 1 no triggers - * @param int $noerrorifdiscountalreadylinked 1=Do not make error if lines is linked to a discount and discount already linked to another - * @return int Return integer <0 if KO, >0 if OK + * @param int<0,1> $notrigger 1 no triggers + * @param int<0,1> $noerrorifdiscountalreadylinked 1=Do not make error if lines is linked to a discount and discount already linked to another + * @return int Return integer <0 if KO, >0 if OK */ public function insert($notrigger = 0, $noerrorifdiscountalreadylinked = 0) { diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 1e6cbedd4fca9..3ffbd79633676 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -411,7 +411,7 @@ // When we show list of files for ECM files, $filearray contains file list, and directory is defined with modulepart + section into $param // When we show list of files for a directory, $filearray ciontains file list, and directory is defined with modulepart + $relativepath // var_dump("section=".$section." title=".$title." modulepart=".$modulepart." useinecm=".$useinecm." perm(permtoeditline)=".$perm." relativepath=".$relativepath." param=".$param." url=".$url); - $formfile->list_of_documents($filearray, '', $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm, '', $sortfield, $sortorder); + $formfile->list_of_documents($filearray, null, $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm, '', $sortfield, $sortorder); } } diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index a71da0914409b..0efdc0fc5c728 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -240,10 +240,10 @@ public function fetch($id) * @param string $sortfield Sort field * @param int $limit limit * @param int $offset Offset - * @param string|array $filter Filter as an Universal Search string or Array (array use is deprecated) + * @param string $filter Filter as an Universal Search string or Array (array use is deprecated) * 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 DefaultValues[]|int int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { diff --git a/htdocs/core/class/diasporahandler.class.php b/htdocs/core/class/diasporahandler.class.php index de93ab4789032..13b9794af17d2 100644 --- a/htdocs/core/class/diasporahandler.class.php +++ b/htdocs/core/class/diasporahandler.class.php @@ -30,7 +30,7 @@ class DiasporaHandler { /** - * @var array Posts fetched from the API + * @var array Posts fetched from the API */ private $posts = []; @@ -180,7 +180,7 @@ private function formatDate($dateString) /** * Get the list of retrieved posts. * - * @return array Posts fetched from the API List of posts. + * @return array Posts fetched from the API */ public function getPosts() { diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 746d99488e5ea..6a2d4e131a5be 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -382,7 +382,7 @@ public function listPrintersTemplates() $this->errors[] = $this->db->lasterror; } - $this->listprinterstemplates = $listofprinters; // @phpstan-ignore-line + $this->listprinterstemplates = $listofprinters; return $error; } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 50f45ceb010d2..be615ae0316b6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -50,7 +50,7 @@ class ExtraFields public $attributes = array(); /** - * @var array Array with boolean of status of groups + * @var array> Array with boolean of status of groups */ public $expand_display; @@ -123,11 +123,11 @@ public function __construct($db) * @param int $pos Position of attribute * @param string $size Size/length definition of attribute ('5', '24,8', ...). For float, it contains 2 numeric separated with a comma. * @param string $elementtype Element type. Same value than object->table_element (Example 'member', 'product', 'thirdparty', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not + * @param int<0,1> $unique Is field unique or not + * @param int<0,1> $required Is field required or not * @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue') - * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) - * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int<0,1> $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param string $list Visibility ('0'=never visible, '1'=visible on list+forms, '2'=list only, '3'=form only or 'eval string') * @param string $help Text with help tooltip @@ -135,9 +135,9 @@ public function __construct($db) * @param string $entity Entity of extrafields (for multicompany modules) * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not - * @param int $totalizable Is a measure. Must show a total on lists - * @param int $printable Is extrafield displayed on PDF - * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...) + * @param int<0,1> $totalizable Is a measure. Must show a total on lists + * @param int<0,1> $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...) * @return int Return integer <=0 if KO, >0 if OK */ public function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array()) @@ -199,11 +199,11 @@ public function addExtraField($attrname, $label, $type, $pos, $size, $elementtyp * @param int $pos Position of attribute * @param string $size Size/length definition of attribute ('5', '24,8', ...). For float, it contains 2 numeric separated with a comma. * @param string $elementtype Element type. Same value than object->table_element (Example 'member', 'product', 'thirdparty', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not + * @param int<0,1> $unique Is field unique or not + * @param int<0,1> $required Is field required or not * @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue') - * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) - * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int<0,1> $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param string $list Visibility ('0'=never visible, '1'=visible on list+forms, '2'=list only, '3'=form only or 'eval string') * @param string $help Text with help tooltip @@ -211,9 +211,9 @@ public function addExtraField($attrname, $label, $type, $pos, $size, $elementtyp * @param string $entity Entity of extrafields (for multicompany modules) * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not - * @param int $totalizable Is a measure. Must show a total on lists - * @param int $printable Is extrafield displayed on PDF - * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...) + * @param int<0,1> $totalizable Is a measure. Must show a total on lists + * @param int<0,1> $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...) * @return int Return integer <=0 if KO, >0 if OK */ public function updateExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array()) @@ -270,15 +270,15 @@ public function updateExtraField($attrname, $label, $type, $pos, $size, $element * @param string $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datetime', 'price', 'pricecy', 'phone', 'mail', 'password', 'url', 'select', 'checkbox', ...) * @param string $length Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not + * @param int<0,1> $unique Is field unique or not + * @param int<0,1> $required Is field required or not * @param string $default_value Default value for field (in database) - * @param array $param Params for field (ex for select list : array('options'=>array('value'=>'label of option')) + * @param array $param Params for field (ex for select list : array('options'=>array('value'=>'label of option')) * @param string $perms Permission * @param string $list Into list view by default * @param string $computed Computed value * @param string $help Help on tooltip - * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) * @return int Return integer <=0 if KO, >0 if OK */ private function create($attrname, $type = 'varchar', $length = '255', $elementtype = '', $unique = 0, $required = 0, $default_value = '', $param = array(), $perms = '', $list = '0', $computed = '', $help = '', $moreparams = array()) @@ -382,10 +382,10 @@ private function create($attrname, $type = 'varchar', $length = '255', $elementt * @param int $pos Position of attribute * @param string $size Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not - * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) - * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param int<0,1> $unique Is field unique or not + * @param int<0,1> $required Is field required or not + * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int<0,1> $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param string $list Visibility * @param string $help Help on tooltip @@ -394,9 +394,9 @@ private function create($attrname, $type = 'varchar', $length = '255', $elementt * @param string $entity Entity of extrafields * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not - * @param int $totalizable Is a measure. Must show a total on lists - * @param int $printable Is extrafield displayed on PDF - * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) + * @param int<0,1> $totalizable Is a measure. Must show a total on lists + * @param int<0,1> $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) * @return int Return integer <=0 if KO, >0 if OK * @throws Exception */ @@ -583,7 +583,7 @@ public function delete($attrname, $elementtype = '') if (empty($error)) { return $result; } else { - return $error*-1; + return $error * -1; } } else { return 0; @@ -637,10 +637,10 @@ private function delete_label($attrname, $elementtype = '') * @param string $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datetime','price','phone','mail','password','url','select','checkbox', ...) * @param string $length Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not - * @param int $pos Position of attribute - * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int<0,1> $unique Is field unique or not + * @param int<0,1> $required Is field required or not + * @param int<0,1> $pos Position of attribute + * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param string $list Visibility @@ -650,9 +650,9 @@ private function delete_label($attrname, $elementtype = '') * @param string $entity Entity of extrafields * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not - * @param int $totalizable Is extrafield totalizable on list - * @param int $printable Is extrafield displayed on PDF - * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) + * @param int<0,1> $totalizable Is extrafield totalizable on list + * @param int<0,1> $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) * @return int >0 if OK, <=0 if KO * @throws Exception */ @@ -792,11 +792,11 @@ public function update($attrname, $label, $type, $length, $elementtype, $unique * @param string $type Type of attribute * @param string $size Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not + * @param int<0,1> $unique Is field unique or not + * @param int<0,1> $required Is field required or not * @param int $pos Position of attribute - * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) - * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param array> $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int<0,1> $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param string $list Visibility * @param string $help Help on tooltip. @@ -805,9 +805,9 @@ public function update($attrname, $label, $type, $length, $elementtype, $unique * @param string $entity Entity of extrafields * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not - * @param int $totalizable Is extrafield totalizable on list - * @param int $printable Is extrafield displayed on PDF - * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) + * @param int<0,1> $totalizable Is extrafield totalizable on list + * @param int<0,1> $printable Is extrafield displayed on PDF + * @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...) * @return int Return integer <=0 if KO, >0 if OK * @throws Exception */ @@ -1067,7 +1067,7 @@ public function fetch_name_optionals_label($elementtype, $forceload = false, $at * Code very similar with showInputField of common object * * @param string $key Key of attribute - * @param string|array $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value); for dates in filter mode, a range array('start'=>, 'end'=>) should be provided + * @param string|array{start:int,end:int} $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value); for dates in filter mode, a range array('start'=>, 'end'=>) should be provided * @param string $moreparam To add more parameters on html input tag * @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names) @@ -1559,7 +1559,7 @@ public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $ if (!is_array($value)) { $value_arr = explode(',', $value); } - $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, '', 0, '100%'); + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, 0, 0, '', 0, '100%'); } elseif ($type == 'radio') { $out = ''; foreach ($param['options'] as $keyopt => $val) { @@ -1823,14 +1823,14 @@ public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $ } $this->db->free($resql); - $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%'); + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, '', 0, '100%'); } else { print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.
'; } } else { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); - $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%'); + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, '', 0, '100%'); } } } elseif ($type == 'link') { @@ -2511,8 +2511,8 @@ public function showSeparator($key, $object, $colspan = 2, $display_type = 'card /** * Fill array_options property of object by extrafields value (using for data sent by forms) * - * @param array|null $extralabels Deprecated (old $array of extrafields, now set this to null) - * @param object $object Object + * @param null $extralabels Deprecated (old $array of extrafields, now set this to null) + * @param CommonObject $object Object * @param string $onlykey Only some keys are filled: * 'string' => When we make update of only one extrafield ($action = 'update_extras'), calling page can set this to avoid to have other extrafields being reset. * '@GETPOSTISSET' => When we make update of several extrafields ($action = 'update'), calling page can set this to avoid to have fields not into POST being reset. @@ -2567,13 +2567,13 @@ public function setOptionalsFromPost($extralabels, &$object, $onlykey = '', $tod && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) && in_array(abs($enabled), array(2, 5)) && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided - ) - ) { - continue; + ) + ) { + continue; } - $visibility_abs = abs($visibility); - // not modify if extra field is not in update form (0 : never, 2 or -2 : list only, 5 or - 5 : list and view only) + $visibility_abs = abs($visibility); + // not modify if extra field is not in update form (0 : never, 2 or -2 : list only, 5 or - 5 : list and view only) if (empty($visibility_abs) || $visibility_abs == 2 || $visibility_abs == 5) { continue; } @@ -2584,9 +2584,9 @@ public function setOptionalsFromPost($extralabels, &$object, $onlykey = '', $tod if ($this->attributes[$object->table_element]['required'][$key]) { // Value is required // Check if functionally empty without using GETPOST (depending on the type of extrafield, a // technically non-empty value may be treated as empty functionally). - // value can be alpha, int, array, etc... - $v = $_POST["options_".$key] ?? null; - $type = $this->attributes[$object->table_element]['type'][$key]; + // value can be alpha, int, array, etc... + $v = $_POST["options_".$key] ?? null; + $type = $this->attributes[$object->table_element]['type'][$key]; if (self::isEmptyValue($v, $type)) { //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; @@ -2658,7 +2658,7 @@ public function setOptionalsFromPost($extralabels, &$object, $onlykey = '', $tod } } - $object->array_options["options_".$key] = $value_key; + $object->array_options["options_".$key] = $value_key; } if ($nofillrequired) { @@ -2677,10 +2677,10 @@ public function setOptionalsFromPost($extralabels, &$object, $onlykey = '', $tod /** * return array_options array of data of extrafields value of object sent by a search form * - * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) + * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @return array|int array_options set or 0 if no value + * @return array|int<0,0> array_options set or 0 if no value */ public function getOptionalsFromPost($extrafieldsobjectkey, $keysuffix = '', $keyprefix = '') { @@ -2846,9 +2846,9 @@ public static function getListOfTypesLabels() /** * Return if a value is "empty" for a mandatory vision. * - * @param mixed $v Value to test + * @param null|int|float|string|array $v Value to test * @param string $type Type of extrafield 'sellist', 'link', 'select', ... - * @return boolean True is value is an empty value, not allowed for a mandatory field. + * @return bool True is value is an empty value, not allowed for a mandatory field. */ public static function isEmptyValue($v, string $type) { @@ -2864,6 +2864,6 @@ public static function isEmptyValue($v, string $type) if ($type == 'sellist') { return ($v == '0'); } - return (empty($v) && $v != '0'); + return empty($v); // Note empty('0') is also true, tested 7.0 up to 8.3.12 } } diff --git a/htdocs/core/class/extralanguages.class.php b/htdocs/core/class/extralanguages.class.php index 541a1c2a6e006..63c1ec50b0582 100644 --- a/htdocs/core/class/extralanguages.class.php +++ b/htdocs/core/class/extralanguages.class.php @@ -34,7 +34,7 @@ class ExtraLanguages public $db; /** - * @var array New array to store extralanguages definition + * @var array> New array to store extralanguages definition */ public $attributes; @@ -77,7 +77,7 @@ public function __construct($db) * * @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). * @param boolean $forceload Force load of extra fields whatever is status of cache. - * @return array Array of attributes keys+label for all extra fields. + * @return array> Array of attributes keys+label for all extra fields. */ public function fetch_name_extralanguages($elementtype, $forceload = false) { diff --git a/htdocs/core/class/fediverseparser.class.php b/htdocs/core/class/fediverseparser.class.php index 1be47f0eab710..9956c03d41c3d 100644 --- a/htdocs/core/class/fediverseparser.class.php +++ b/htdocs/core/class/fediverseparser.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 @@ -84,7 +85,7 @@ public function parser($urlAPI, $maxNb = 5, $cacheDelay = 60, $cacheDir = '') /** * Get the list of retrieved posts. * - * @return array List of posts. + * @return array Posts fetched from the API */ public function getPosts() { @@ -94,7 +95,7 @@ public function getPosts() /** * Get the last fetch date. * - * @return int|String Timestamp of the last successful fetch. + * @return int|string Timestamp of the last successful fetch. */ public function getLastFetchDate() { diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index ca504ec621a81..675a22ae0fed8 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011-2022 Regis Houssin * Copyright (C) 2011-2023 Laurent Destailleur * 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 @@ -33,7 +34,13 @@ */ class FileUpload { + /** + * @var array{script_url:string,upload_dir:string,upload_url:string,param_name:string,delete_type:string,max_file_size:?int,min_file_size:int,accept_file_types:string,max_number_of_files:?int,max_width:?int,max_height:?int,min_width:int,min_height:int,discard_aborted_uploads:bool,image_versions:array} + */ public $options; + /** + * @var int + */ protected $fk_element; /** @@ -45,7 +52,7 @@ class FileUpload * Constructor. * This set ->$options * - * @param array $options Options array + * @param ?array{script_url?:string,upload_dir?:string,upload_url?:string,param_name?:string,delete_type?:string,max_file_size?:?int,min_file_size?:int,accept_file_types?:string,max_number_of_files?:?int,max_width?:?int,max_height?:?int,min_width?:int,min_height?:int,discard_aborted_uploads?:bool,image_versions?:array} $options Options array * @param int $fk_element ID of element * @param string $element Code of element */ @@ -73,6 +80,7 @@ public function __construct($options = null, $fk_element = null, $element = null throw new Exception('The element '.$element.' is not supported for uploading file. dir_output is unknown.'); } + $object_ref = 'UndefinedReference'; // If pathname and filename are null then we can still upload files if we have specified upload_dir on $options if ($pathname !== null && $filename !== null) { // Get object from its id and type @@ -196,7 +204,7 @@ protected function getFullUrl() /** * Set delete url * - * @param object $file Filename + * @param stdClass $file File object (see getFileObject) * @return void */ protected function setFileDeleteUrl($file) @@ -212,7 +220,7 @@ protected function setFileDeleteUrl($file) * getFileObject * * @param string $file_name Filename - * @return stdClass|null + * @return ?stdClass */ protected function getFileObject($file_name) { @@ -243,7 +251,7 @@ protected function getFileObject($file_name) /** * getFileObjects * - * @return array Array of objects + * @return array Array of objects */ protected function getFileObjects() { @@ -253,9 +261,9 @@ protected function getFileObjects() /** * Create thumbs of a file uploaded. * - * @param string $file_name Filename - * @param string $options is array('max_width', 'max_height') - * @return boolean + * @param string $file_name Filename + * @param array{upload_dir:string} $options is array('max_width', 'max_height') + * @return bool */ protected function createScaledImage($file_name, $options) { diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 6c378869f5e5d..0edc34a55a353 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -460,7 +460,7 @@ public function info($id) * * @param int|string $datestart Date start to scan * @param int|string $dateend Date end to scan - * @return string Number of entries + * @return int Number of entries */ public function getAccountancyEntriesByFiscalYear($datestart = '', $dateend = '') { @@ -478,10 +478,11 @@ public function getAccountancyEntriesByFiscalYear($datestart = '', $dateend = '' $sql .= " WHERE entity IN (".getEntity('bookkeeping', 0).")"; $sql .= " AND doc_date >= '".$this->db->idate($datestart)."' and doc_date <= '".$this->db->idate($dateend)."'"; + $nb = 0; $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - $nb = $obj->nb; + $nb = (int) $obj->nb; } else { dol_print_error($this->db); } @@ -494,7 +495,7 @@ public function getAccountancyEntriesByFiscalYear($datestart = '', $dateend = '' * * @param int|string $datestart Date start to scan * @param int|string $dateend Date end to scan - * @return string Number of movements + * @return int Number of movements */ public function getAccountancyMovementsByFiscalYear($datestart = '', $dateend = '') { @@ -512,10 +513,11 @@ public function getAccountancyMovementsByFiscalYear($datestart = '', $dateend = $sql .= " WHERE entity IN (".getEntity('bookkeeping', 0).")"; $sql .= " AND doc_date >= '".$this->db->idate($datestart)."' and doc_date <= '".$this->db->idate($dateend)."'"; + $nb = 0; $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - $nb = $obj->nb; + $nb = (int) $obj->nb; } else { dol_print_error($this->db); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 48ab53f7ee6cd..8a18f84481d59 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1731,15 +1731,15 @@ public function select_thirdparty_list($selected = '', $htmlname = 'socid', $fil * Note: you must use the select_contact() to get the component to select a contact. This function must only be called by select_contact. * * @param int $socid Id of third party or 0 for all or -1 for empty list - * @param array|int|string $selected Array of ID of preselected contact id + * @param string[]|int|string $selected Array of ID of preselected contact id * @param string $htmlname Name of HTML field ('none' for a not editable field) * @param int<0,3>|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list * @param string $exclude List of contacts id to exclude * @param string $limitto Disable answers that are not id in this array list - * @param integer $showfunction Add function into label + * @param int<0,1> $showfunction Add function into label * @param string $morecss Add more class to class style * @param int $options_only 1=Return options only (for ajax treatment), 2=Return array - * @param integer $showsoc Add company into label + * @param int<0,1> $showsoc Add company into label * @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container @@ -2881,21 +2881,21 @@ public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $st * @param int $limit Limit on number of returned lines * @param int $price_level Level of price to show * @param string $filterkey Filter on product - * @param int $status -1=Return all products, 0=Products not on sell, 1=Products on sell + * @param int<-1,1> $status -1=Return all products, 0=Products not on sell, 1=Products on sell * @param int $finished Filter on finished field: 2=No filter * @param int $outputmode 0=HTML select string, 1=Array * @param int $socid Thirdparty Id (to get also price dedicated to this customer) * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. * @param int $forcecombo Force to use combo box * @param string $morecss Add more css on select - * @param int $hidepriceinlabel 1=Hide prices in label - * @param string $warehouseStatus Warehouse status filter to group/count stock. Following comma separated filter options can be used. - * 'warehouseopen' = count products from open warehouses, - * 'warehouseclosed' = count products from closed warehouses, - * 'warehouseinternal' = count products from warehouses for internal correct/transfer only - * @param int $status_purchase Purchase status -1=Return all products, 0=Products not on purchase, 1=Products on purchase + * @param int<0,1> $hidepriceinlabel 1=Hide prices in label + * @param ''|'warehouseopen'|'warehouseclosed'|'warehouseinternal' $warehouseStatus Warehouse status filter to group/count stock. Following comma separated filter options can be used. + * 'warehouseopen' = count products from open warehouses, + * 'warehouseclosed' = count products from closed warehouses, + * 'warehouseinternal' = count products from warehouses for internal correct/transfer only + * @param int<-1,1> $status_purchase Purchase status -1=Return all products, 0=Products not on purchase, 1=Products on purchase * @param int $warehouseId Filter by Warehouses Id where there is real stock - * @return array|string Array of keys for json + * @return string|array Array of keys for json */ public function select_produits_list($selected = 0, $htmlname = 'productid', $filtertype = '', $limit = 20, $price_level = 0, $filterkey = '', $status = 1, $finished = 2, $outputmode = 0, $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = 'maxwidth500', $hidepriceinlabel = 0, $warehouseStatus = '', $status_purchase = -1, $warehouseId = 0) { @@ -3201,7 +3201,7 @@ public function select_produits_list($selected = 0, $htmlname = 'productid', $fi //$objp->default_vat_code is not overwritten by $objp2 value $this->constructProductListOption($objp, $opt, $optJson, 0, $selected, $hidepriceinlabel, $filterkey); - + '@phan-var-force array{key:string,value:string,label:string,label2:string,desc:string,type:string,price_ht:string,price_ttc:string,price_ht_locale:string,price_ttc_locale:string,pricebasetype:string,tva_tx:string,default_vat_code:string,qty:string,discount:string,duration_value:string,duration_unit:string,pbq:string,labeltrans:string,desctrans:string,ref_customer:string} $optJson'; $j++; // Add new entry @@ -3264,7 +3264,7 @@ public function select_produits_list($selected = 0, $htmlname = 'productid', $fi * * @param stdClass $objp Resultset of fetch * @param string $opt Option (var used for returned value in string option format) - * @param array{key:string,value:string,label:string,label2:string,desc:string,type:string,price_ht:string,price_ttc:string,price_ht_locale:string,price_ttc_locale:string,pricebasetype:string,tva_tx:string,default_vat_code:string,qty:string,discount:string,duration_value:string,duration_unit:string,pbq:string,labeltrans:string,desctrans:string,ref_customer:string} $optJson Option (var used for returned value in json format) + * @param array{key?:string,value?:string,label?:string,label2?:string,desc?:string,type?:string,price_ht?:string,price_ttc?:string,price_ht_locale?:string,price_ttc_locale?:string,pricebasetype?:string,tva_tx?:string,default_vat_code?:string,qty?:string,discount?:string,duration_value?:string,duration_unit?:string,pbq?:string,labeltrans?:string,desctrans?:string,ref_customer?:string} $optJson Option (var used for returned value in json format) * @param int $price_level Price level * @param int $selected Preselected value * @param int<0,1> $hidepriceinlabel Hide price in label @@ -3696,7 +3696,7 @@ public function select_produits_fournisseurs($socid, $selected = '', $htmlname = * @param string $morecss Add more CSS * @param int $showstockinlist Show stock information (slower). * @param string $placeholder Placeholder - * @return array|string Array of keys for json or HTML component + * @return array>|string Array of keys for json or HTML component */ public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0, $placeholder = '') { @@ -7022,12 +7022,12 @@ public function selectDateToDate($set_time = '', $set_time_end = '', $prefix = ' * @param int<0,1> $disabled Disable input fields * @param int|string $fullday When a checkbox with id #fullday is checked, hours are set with 00:00 (if value if 'fulldaystart') or 23:59 (if value is 'fulldayend') * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field. - * @param int|string|array $adddateof Add a link "Date of ..." using the following date. Must be array(array('adddateof' => ..., 'labeladddateof' => ...)) + * @param int|string|array $adddateof Add a link "Date of ..." using the following date. Must be array(array('adddateof' => ..., 'labeladddateof' => ...)) * @param string $openinghours Specify hour start and hour end for the select ex 8,20 * @param int $stepminutes Specify step for minutes between 1 and 30 * @param string $labeladddateof Label to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array. * @param string $placeholder Placeholder - * @param mixed $gm 'auto' (for backward compatibility, avoid this), 'gmt' or 'tzserver' or 'tzuserrel' + * @param 'auto'|'gmt'|'tzserver'|'tzuserrel' $gm 'auto' (for backward compatibility, avoid this), 'gmt' or 'tzserver' or 'tzuserrel' * @return string Html for selectDate * @see form_date(), select_month(), select_year(), select_dayofweek() */ @@ -7679,7 +7679,7 @@ public function selectTickets($selected = '', $htmlname = 'ticketid', $filtertyp * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. * @param int $forcecombo Force to use combo box * @param string $morecss Add more css on select - * @return array|string Array of keys for json or HTML component + * @return array|string Array of keys for json or HTML component */ public function selectTicketsList($selected = '', $htmlname = 'ticketid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') { @@ -7764,6 +7764,7 @@ public function selectTicketsList($selected = '', $htmlname = 'ticketid', $filte $objp = $this->db->fetch_object($result); $this->constructTicketListOption($objp, $opt, $optJson, $selected, $filterkey); + '@phan-var-force array{key:string,value:mixed,type:int} $optJson'; // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box @@ -7794,7 +7795,7 @@ public function selectTicketsList($selected = '', $htmlname = 'ticketid', $filte * * @param object $objp Result set of fetch * @param string $opt Option (var used for returned value in string option format) - * @param mixed[] $optJson Option (var used for returned value in json format) + * @param array{key?:string,value?:mixed,type?:int} $optJson Option (var used for returned value in json format) * @param string $selected Preselected value * @param string $filterkey Filter key to highlight * @return void @@ -7903,7 +7904,7 @@ public function selectProjects($selected = '', $htmlname = 'projectid', $filtert * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. * @param int $forcecombo Force to use combo box * @param string $morecss Add more css on select - * @return array|string Array of keys for json or HTML component + * @return mixed[]|string Array of keys for json or HTML component */ public function selectProjectsList($selected = '', $htmlname = 'projectid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') { @@ -8135,7 +8136,7 @@ public function selectMembers($selected = '', $htmlname = 'adherentid', $filtert * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. * @param int $forcecombo Force to use combo box * @param string $morecss Add more css on select - * @return array|string Array of keys for json or HTML string component + * @return mixed[]|string Array of keys for json or HTML string component */ public function selectMembersList($selected = '', $htmlname = 'adherentid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') { @@ -8253,7 +8254,7 @@ public function selectMembersList($selected = '', $htmlname = 'adherentid', $fil * * @param object $objp Result set of fetch * @param string $opt Option (var used for returned value in string option format) - * @param mixed[] $optJson Option (var used for returned value in json format) + * @param array{key?:string,value?:mixed,type?:int} $optJson Option (var used for returned value in json format) * @param string $selected Preselected value * @param string $filterkey Filter key to highlight * @return void @@ -8482,7 +8483,7 @@ public function selectForForms($objectdesc, $htmlname, $preSelectedValue, $showe * @param int $disabled 1=Html component is disabled * @param string $sortfield Sort field * @param string $filter Add more filter (Universal Search Filter) - * @return string|array Return HTML string + * @return string|array Return HTML string * @see selectForForms() */ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0, $sortfield = '', $filter = '') diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 60630b9c86056..fae07b24a6b91 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -376,6 +376,7 @@ public function select_account($selectid, $htmlname = 'account', $showempty = 0, require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $out = ''; + $selected = ''; $options = array(); diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index f0a7b099c4a18..57f86f121cf39 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -525,7 +525,6 @@ public function selectTypeOfFields($htmlname, $type, $typewecanchangeinto = arra // Set $valhtml with the picto for the type $valhtml = ($key ? getPictoForType($key) : '').$val; - // @phpstan-ignore-next-line if (empty($typewecanchangeinto) || in_array($key, $typewecanchangeinto[$type])) { $out .= ''; } else { diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 992e676b89e34..d113aa44d6cbe 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2012 Regis Houssin * Copyright (C) 2008-2012 Laurent Destailleur * Copyright (C) 2018-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 @@ -55,7 +56,7 @@ public function __construct($db) * Return HTML select with list of bar code generators * * @param int $selected Id code pre-selected - * @param array $barcodelist Array of barcodes generators + * @param array $barcodelist Array of barcodes generators * @param int $code_id Id du code barre * @param string $idForm Id of html form, ex id="idform" * @return string HTML select string diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index 731559ed119de..4a91fbc99f7e3 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.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 @@ -35,12 +36,12 @@ class FormCategory extends Form * Return a HTML filter box for a list filter view * * @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE) - * @param array $preSelected A list with the elements that should pre-selected + * @param array $preSelected A list with the elements that should pre-selected * @param string $morecss More CSS - * @param int $searchCategoryProductOperator Used only if $multiselect is 1. Set to 0 or 1 to enable the checkbox to search with a or (0=not preseleted, 1=preselected), -1=Checkbox never shown. - * @param int $multiselect 0 or 1 - * @param int $nocateg 1=Add an entry '- No Category -' - * @param string $showempty 1 or 'string' to add an empty entry + * @param int<-1,1> $searchCategoryProductOperator Used only if $multiselect is 1. Set to 0 or 1 to enable the checkbox to search with a or (0=not preselected, 1=preselected), -1=Checkbox never shown. + * @param int<0,1> $multiselect 0 or 1 + * @param int<0,1> $nocateg 1=Add an entry '- No Category -' + * @param int<1,1>|string $showempty 1 or 'string' to add an empty entry * @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list")) */ public function getFilterBox($type, array $preSelected, $morecss = "minwidth300imp widthcentpercentminusx", $searchCategoryProductOperator = -1, $multiselect = 1, $nocateg = 1, $showempty = '') diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d58b41eb02ba1..49822c0ef3833 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -91,7 +91,7 @@ public function __construct($db) * @param int<0,1> $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept. * @param int<0,1> $disablemulti 0=Default, 1=Disable multiple file upload * @param int<0,1> $nooutput 0=Output result with print, 1=Return result - * @return int|string|array Return integer <0 if KO, >0 if OK, or string if $noouput=1 or array if $nooutput=2 + * @return int|string|array{formToUploadAFile:string,formToAddALink:string} Return integer <0 if KO, >0 if OK, or string if $nooutput=1 or array if $nooutput=2 */ public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = null, $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0, $disablemulti = 0, $nooutput = 0) { @@ -425,7 +425,7 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $hookmanager->initHooks(array('formfile')); // Get list of files - $file_list = null; + $file_list = array(); if (!empty($filedir)) { $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } @@ -802,7 +802,7 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, if ($conf->browser->layout == 'phone') { $morecss = 'maxwidth100'; } - $out .= $formadmin->select_language($defaultlang, 'lang_id', 0, null, 0, 0, 0, $morecss); + $out .= $formadmin->select_language($defaultlang, 'lang_id', 0, array(), 0, 0, 0, $morecss); } else { $out .= ' '; } @@ -851,7 +851,7 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, if (is_object($object)) { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $link = new Link($this->db); - $sortfield = $sortorder = null; + $sortfield = $sortorder = ''; $res = $link->fetchAll($link_list, $object->element, $object->id, $sortfield, $sortorder); } @@ -868,6 +868,7 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, // Loop on each file found if (is_array($file_list)) { + '@phan-var-force array $file_list'; // phan limitations loose typing information with empty() tests, etc. Force again. // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -887,12 +888,12 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, foreach ($file_list as $file) { // Define relative path for download link (depends on module) - $relativepath = $file["name"]; // Cas general + $relativepath = (string) $file["name"]; // Cas general if ($modulesubdir) { - $relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture... + $relativepath = (string) $modulesubdir."/".$file["name"]; // Cas propal, facture... } if ($modulepart == 'export') { - $relativepath = $file["name"]; // Other case + $relativepath = (string) $file["name"]; // Other case } $out .= ''; @@ -1123,20 +1124,20 @@ public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = // Define relative path for download link (depends on module) $relativepath = $file["name"]; // Cas general if ($modulesubdir) { - $relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture... + $relativepath = (string) $modulesubdir."/".$file["name"]; // Cas propal, facture... } // Autre cas if ($modulepart == 'donation') { - $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"]; + $relativepath = (string) get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"]; } if ($modulepart == 'export') { - $relativepath = $file["name"]; + $relativepath = (string) $file["name"]; } $this->infofiles['nboffiles']++; $this->infofiles['files'][] = $file['fullname']; - $ext = pathinfo($file['name'], PATHINFO_EXTENSION); - if (empty($this->infofiles['extensions'][$ext])) { + $ext = (string) pathinfo($file['name'], PATHINFO_EXTENSION); // pathinfo returns a string here (cast for static analysis) + if (!array_key_exists($ext, $this->infofiles['extensions'])) { $this->infofiles['extensions'][$ext] = 1; } else { $this->infofiles['extensions'][$ext]++; @@ -1189,8 +1190,8 @@ public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = * Show list of documents in $filearray (may be they are all in same directory but may not) * This also sync database if $upload_dir is defined. * - * @param array $filearray Array of files loaded by dol_dir_list('files') function before calling this. - * @param Object|null $object Object on which document is linked to. + * @param array $filearray Array of files loaded by dol_dir_list('files') function before calling this. + * @param ?CommonObject $object Object on which document is linked to. * @param string $modulepart Value for modulepart used by download or viewimage wrapper. * @param string $param Parameters on sort links (param must start with &, example &aaa=bbb&ccc=ddd) * @param int $forcedownload Force to open dialog box "Save As" when clicking on file. @@ -1716,7 +1717,7 @@ public function list_of_documents($filearray, $object, $modulepart, $param = '', * Show list of documents in a directory of ECM module. * * @param string $upload_dir Directory that was scanned. This directory will contains files into subdirs REF/files - * @param array $filearray Array of files loaded by dol_dir_list function before calling this function + * @param array $filearray Array of files loaded by dol_dir_list('files') function before calling this. * @param string $modulepart Value for modulepart used by download wrapper. Value can be $object->table_name (that is 'myobject' or 'mymodule_myobject') or $object->element.'-'.$module (for compatibility purpose) * @param string $param Parameters on sort links * @param int $forcedownload Force to open dialog box "Save As" when clicking on file @@ -2265,7 +2266,7 @@ public function listOfLinks($object, $permissiontodelete = 1, $action = null, $s /** * Show detail icon with link for preview * - * @param array $file Array with data of file. Example: array('name'=>...) + * @param array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string} $file Array with data of file. Example: array('name'=>...) * @param string $modulepart propal, facture, facture_fourn, ... * @param string $relativepath Relative path of docs * @param integer $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file). Use a negative value to show a generic picto even if preview not available. diff --git a/htdocs/core/class/html.formldap.class.php b/htdocs/core/class/html.formldap.class.php index 04c204edfd2df..d96cbcca56850 100644 --- a/htdocs/core/class/html.formldap.class.php +++ b/htdocs/core/class/html.formldap.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 @@ -108,8 +109,8 @@ public function selectLdapPasswordHashType($selected = 'md5', $htmlname = 'ldaph * * @param int $selected Preselected type * @param string $htmlname Name of field in form - * @param array $exclude Exclude values from the list - * @param int $scriptonly Add warning if synchro only work with a script (0 = disable, 1 = Dolibarr2ldap, 2 = ldap2dolibarr, 3 = all) + * @param string[] $exclude Exclude values from the list + * @param int<0,3> $scriptonly Add warning if synchro only work with a script (0 = disable, 1 = Dolibarr2ldap, 2 = ldap2dolibarr, 3 = all) * @param int $showempty Add an empty field * @return string HTML select string */ diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index fdc36ef21c302..17035cbd195b4 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -57,8 +57,8 @@ public function __construct($db) * TODO Move this in common class. * * @param CommonObject $object Object we want to get margin information for - * @param boolean $force_price True of not - * @return array Array with info + * @param bool $force_price True of not + * @return array{pa_products:float,pv_products:float, margin_on_products:float, margin_rate_products :string, mark_rate_products :string, pa_services:float, pv_services:float, margin_on_services:float, margin_rate_services :string, mark_rate_services :string, pa_total:float, pv_total:float, total_margin:float, total_margin_rate :string, total_mark_rate :string} Array with info */ public function getMarginInfosArray($object, $force_price = false) { @@ -99,13 +99,16 @@ public function getMarginInfosArray($object, $force_price = false) } $pv = $line->total_ht; - // We chose to have line->pa_ht always positive in database, so we guess the correct sign - // @phan-suppress-next-line PhanUndeclaredConstantOfClass + + // $line->pa_ht is always positive in database, so we guess the correct sign + + '@phan-var-force Facture|FactureFournisseur $object'; $pa_ht = (($pv < 0 || ($pv == 0 && in_array($object->element, array('facture', 'facture_fourn')) && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); + '@phan-var-force CommonObject $object'; + if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode - // @phan-suppress-next-line PhanUndeclaredConstantOfClass + '@phan-var-force Facture $object'; if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) - // @phan-suppress-next-line PhanUndeclaredConstantOfClass || ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) { // We need a compensation relative to $line->situation_percent $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 0ad93d71af6f3..fe15a87d32361 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -46,6 +46,9 @@ class FormProjets extends Form public $errors = array(); + /** + * @var int + */ public $nboftasks; @@ -149,7 +152,8 @@ public function select_projects($socid = -1, $selected = '', $htmlname = 'projec * @param string $htmlid Html id to use instead of htmlname * @param string $morecss More CSS * @param string $morefilter More filters (Must be a sql sanitized string) - * @return int|string|array HTML string or array of option or <0 if KO + * @return int|string|array HTML string or array of option or <0 if KO + */ public function select_projects_list($socid = -1, $selected = 0, $htmlname = 'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $htmlid = '', $morecss = 'maxwidth500', $morefilter = '') { @@ -818,7 +822,7 @@ public function selectProjectsStatus($selected = '', $short = 0, $hmlname = 'ord * @param string $htmlNameInvoice Name of HTML select for Invoice * @param string $htmlNameInvoiceLine Name of HTML select for Invoice Line * @param string $morecss More css added to the select component - * @param array $filters Array of filters + * @param array $filters Array of filters * @param int $lineOnly return only option for line * @return string HTML Select */ diff --git a/htdocs/core/class/mastodonhandler.class.php b/htdocs/core/class/mastodonhandler.class.php index 30d81a3276914..c35a55aea9647 100644 --- a/htdocs/core/class/mastodonhandler.class.php +++ b/htdocs/core/class/mastodonhandler.class.php @@ -185,7 +185,7 @@ private function formatDate($dateString) /** * Get the list of retrieved posts. * - * @return array List of posts + * @return array Posts fetched from the API */ public function getPosts() { diff --git a/htdocs/core/class/reddithandler.class.php b/htdocs/core/class/reddithandler.class.php index 429bc2a5b2252..248ef1e46e5a8 100644 --- a/htdocs/core/class/reddithandler.class.php +++ b/htdocs/core/class/reddithandler.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 @@ -70,7 +71,7 @@ class RedditHandler public $error = ''; /** - * @var Array posts of social network (Mastodon) + * @var array Posts of the social network */ private $posts; @@ -236,7 +237,7 @@ private function formatDate($dateString) /** * Get the list of retrieved posts. * - * @return array List of posts. + * @return array Posts fetched from the API */ public function getPosts() { diff --git a/htdocs/core/class/socialnetworkmanager.class.php b/htdocs/core/class/socialnetworkmanager.class.php index 7df9a6b90e8be..2a6f3395efe6a 100644 --- a/htdocs/core/class/socialnetworkmanager.class.php +++ b/htdocs/core/class/socialnetworkmanager.class.php @@ -111,7 +111,7 @@ public function fetchPosts($urlAPI, $maxNb = 5, $cacheDelay = 60, $cacheDir = '' /** * Get the list of retrieved posts. * - * @return array List of posts. + * @return array Posts fetched from the API */ public function getPosts() { diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 8055f176111ec..44b0eadb29b7e 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-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 @@ -117,79 +118,79 @@ if (isModEnabled("product") || isModEnabled("service")) { $langs->load("products"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); + $sectionauto[] = array('level' => 1, 'module' => 'product', 'test' => (isModEnabled("product") || isModEnabled("service")), 'label' => $langs->trans("ProductsAndServices"), 'desc' => $langs->trans("ECMDocsByProducts")); } if (isModEnabled("societe")) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties"))); + $sectionauto[] = array('level' => 1, 'module' => 'company', 'test' => isModEnabled('societe'), 'label' => $langs->trans("ThirdParties"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties"))); } if (isModEnabled("propal")) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); + $sectionauto[] = array('level' => 1, 'module' => 'propal', 'test' => isModEnabled('propal'), 'label' => $langs->trans("Proposals"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } if (isModEnabled('contract')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contract'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); + $sectionauto[] = array('level' => 1, 'module' => 'contract', 'test' => isModEnabled('contract'), 'label' => $langs->trans("Contracts"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } if (isModEnabled('order')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('order'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); + $sectionauto[] = array('level' => 1, 'module' => 'order', 'test' => isModEnabled('order'), 'label' => $langs->trans("CustomersOrders"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } if (isModEnabled('invoice')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('invoice'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); + $sectionauto[] = array('level' => 1, 'module' => 'invoice', 'test' => isModEnabled('invoice'), 'label' => $langs->trans("CustomersInvoices"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>isModEnabled('supplier_proposal'), 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); + $sectionauto[] = array('level' => 1, 'module' => 'supplier_proposal', 'test' => isModEnabled('supplier_proposal'), 'label' => $langs->trans("SupplierProposals"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } if (isModEnabled("supplier_order")) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>isModEnabled("supplier_order"), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); + $sectionauto[] = array('level' => 1, 'module' => 'order_supplier', 'test' => isModEnabled("supplier_order"), 'label' => $langs->trans("SuppliersOrders"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); } if (isModEnabled("supplier_invoice")) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>isModEnabled("supplier_invoice"), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); + $sectionauto[] = array('level' => 1, 'module' => 'invoice_supplier', 'test' => isModEnabled("supplier_invoice"), 'label' => $langs->trans("SuppliersInvoices"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } if (isModEnabled('tax')) { $langs->load("compta"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); + $sectionauto[] = array('level' => 1, 'module' => 'tax', 'test' => isModEnabled('tax'), 'label' => $langs->trans("SocialContributions"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); } if (isModEnabled('project')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); + $sectionauto[] = array('level' => 1, 'module' => 'project', 'test' => isModEnabled('project'), 'label' => $langs->trans("Projects"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); } if (isModEnabled('intervention')) { $langs->load("interventions"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('intervention'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); + $sectionauto[] = array('level' => 1, 'module' => 'fichinter', 'test' => isModEnabled('intervention'), 'label' => $langs->trans("Interventions"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } if (isModEnabled('expensereport')) { $langs->load("trips"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>isModEnabled('expensereport'), 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); + $sectionauto[] = array('level' => 1, 'module' => 'expensereport', 'test' => isModEnabled('expensereport'), 'label' => $langs->trans("ExpenseReports"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } if (isModEnabled('holiday')) { $langs->load("holiday"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); + $sectionauto[] = array('level' => 1, 'module' => 'holiday', 'test' => isModEnabled('holiday'), 'label' => $langs->trans("Holidays"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } if (isModEnabled("bank")) { $langs->load("banks"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('bank'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); + $sectionauto[] = array('level' => 1, 'module' => 'banque', 'test' => isModEnabled('bank'), 'label' => $langs->trans("BankAccount"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); } if (isModEnabled('mrp')) { $langs->load("mrp"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); + $sectionauto[] = array('level' => 1, 'module' => 'mrp-mo', 'test' => isModEnabled('mrp'), 'label' => $langs->trans("MOs"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); } if (isModEnabled('recruitment')) { $langs->load("recruitment"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>isModEnabled('recruitment'), 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); + $sectionauto[] = array('level' => 1, 'module' => 'recruitment-recruitmentcandidature', 'test' => isModEnabled('recruitment'), 'label' => $langs->trans("Candidatures"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); } @@ -265,7 +266,7 @@ $formfile = new FormFile($db); $param = '§ion='.urlencode($section); $textifempty = ($section ? $langs->trans("NoFileFound") : $langs->trans("ECMSelectASection")); -$formfile->list_of_documents($filearray, '', 'ecm', $param, 1, $relativepath, $user->hasRight('ecm', 'upload'), 1, $textifempty); +$formfile->list_of_documents($filearray, null, 'ecm', $param, 1, $relativepath, $user->hasRight('ecm', 'upload'), 1, $textifempty); print ''; From 20ce66f4bad459441c2271d4256b36a8d0dcf815 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 23 Oct 2024 12:21:11 +0200 Subject: [PATCH 4/8] Qual: Fix notices formsetup...formwebsite.class --- dev/tools/phan/baseline.txt | 21 ++++--------- htdocs/core/class/html.formfile.class.php | 32 ++++++++++---------- htdocs/core/class/html.formsetup.class.php | 20 ++++++------ htdocs/core/class/html.formwebsite.class.php | 12 +++++--- 4 files changed, 40 insertions(+), 45 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 8344f9882a183..c5560a35da1e3 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,10 +9,10 @@ */ return [ // # Issue statistics: - // PhanUndeclaredProperty : 640+ occurrences - // PhanPluginUnknownPropertyType : 630+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 580+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 400+ occurrences + // PhanUndeclaredProperty : 560+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 550+ occurrences + // PhanPluginUnknownPropertyType : 420+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 360+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences // PhanPluginUnknownArrayMethodReturnType : 280+ occurrences // PhanPluginUnknownArrayMethodParamType : 190+ occurrences @@ -25,14 +25,12 @@ return [ // PhanRedefineFunction : 50+ occurrences // PhanPluginEmptyStatementIf : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences - // PhanPluginUnknownArrayPropertyType : 35+ occurrences // PhanTypeInvalidDimOffset : 35+ occurrences + // PhanPluginUnknownArrayPropertyType : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences // PhanPluginUnknownObjectMethodCall : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanEmptyForeach : 10+ occurrences - // PhanPluginConstantVariableNull : 10+ occurrences - // PhanPossiblyNullTypeMismatchProperty : 10+ occurrences // PhanTypeArraySuspiciousNull : 10+ occurrences // PhanTypeComparisonFromArray : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences @@ -256,8 +254,6 @@ return [ 'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formfile.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ldap.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/link.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], @@ -727,11 +723,9 @@ return [ 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/salaries/class/paymentsalary.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/class/salariesstats.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/salaries/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/salaries/info.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -779,7 +773,6 @@ return [ 'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'], 'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'], 'htdocs/user/bank.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -803,8 +796,6 @@ return [ 'htdocs/webportal/class/controller.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/webportal/class/webportalinvoice.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/webportal/class/webportalmember.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/webservices/server_actioncomm.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_category.php' => ['PhanUndeclaredProperty'], diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 49822c0ef3833..471c571a680e7 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1194,10 +1194,10 @@ public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = * @param ?CommonObject $object Object on which document is linked to. * @param string $modulepart Value for modulepart used by download or viewimage wrapper. * @param string $param Parameters on sort links (param must start with &, example &aaa=bbb&ccc=ddd) - * @param int $forcedownload Force to open dialog box "Save As" when clicking on file. + * @param int<0,1> $forcedownload Force to open dialog box "Save As" when clicking on file. * @param string $relativepath Relative path of docs (autodefined if not provided), relative to module dir, not to MAIN_DATA_ROOT. - * @param int $permonobject Permission on object (so permission to delete or crop document) - * @param int $useinecm Change output to add more information: + * @param int<0,1> $permonobject Permission on object (so permission to delete or crop document) + * @param int<0,6> $useinecm Change output to add more information: * 0, 4, 5, 6: Add a preview column. Show also a rename button. Show also a crop button for some values of $modulepart (must be supported into hard coded list in this function + photos_resize.php + restrictedArea + checkUserAccessToObject) * 1: Add link to edit ECM entry * 2: Add rename and crop link @@ -1206,16 +1206,16 @@ public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = * @param int $maxlength Maximum length of file name shown. * @param string $title Title before list. Use 'none' to disable title. * @param string $url Full url to use for click links ('' = autodetect) - * @param int $showrelpart 0=Show only filename (default), 1=Show first level 1 dir - * @param int $permtoeditline Permission to edit document line (You must provide a value, -1 is deprecated and must not be used any more) + * @param int<0,1> $showrelpart 0=Show only filename (default), 1=Show first level 1 dir + * @param int<-1,1> $permtoeditline Permission to edit document line (You must provide a value, -1 is deprecated and must not be used any more) * @param string $upload_dir Full path directory so we can know dir relative to MAIN_DATA_ROOT. Fill this to complete file data with database indexes. * @param string $sortfield Sort field ('name', 'size', 'position', ...) * @param string $sortorder Sort order ('ASC' or 'DESC') - * @param int $disablemove 1=Disable move button, 0=Position move is possible. - * @param int $addfilterfields Add the line with filters - * @param int $disablecrop Disable crop feature on images (-1 = auto, prefer to set it explicitly to 0 or 1) + * @param int<0,1> $disablemove 1=Disable move button, 0=Position move is possible. + * @param int<0,1> $addfilterfields Add the line with filters + * @param int<-1,1> $disablecrop Disable crop feature on images (-1 = auto, prefer to set it explicitly to 0 or 1) * @param string $moreattrondiv More attributes on the div for responsive. Example 'style="height:280px; overflow: auto;"' - * @param array $moreoptions Add more options like array('afteruploadtitle', ...) + * @param array $moreoptions Add more options like array('afteruploadtitle', ...) * @return int Return integer <0 if KO, nb of files shown if OK * @see list_of_autoecmfiles() */ @@ -2110,13 +2110,13 @@ public function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $para /** * Show array with linked files * - * @param Object $object Object - * @param int $permissiontodelete Deletion is allowed - * @param string $action Action - * @param string $selected ??? - * @param string $param More param to add into URL - * @param string $htmlname Html name of component - * @param array $moreoptions Add more options like array('afterlinktitle', ...) + * @param CommonObject $object Object + * @param int<0,1> $permissiontodelete Deletion is allowed + * @param ?string $action Action + * @param ?string $selected ??? + * @param string $param More param to add into URL + * @param string $htmlname Html name of component + * @param array $moreoptions Add more options like array('afterlinktitle', ...) * @return int Number of links */ public function listOfLinks($object, $permissiontodelete = 1, $action = null, $selected = null, $param = '', $htmlname = 'formaddlink', $moreoptions = array()) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index e475289c5b635..9a74a5cf44ba2 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -67,7 +67,7 @@ class FormSetup /** * - * @var array + * @var array */ public $formAttributes = array( 'action' => '', // set in __construct @@ -76,7 +76,7 @@ class FormSetup /** * an list of hidden inputs used only in edit mode - * @var array + * @var array Currently array{token:string,action:string} */ public $formHiddenInputs = array(); @@ -116,7 +116,7 @@ public function __construct($db, $outputLangs = null) /** * Generate an attributes string form an input array * - * @param array $attributes an array of attributes keys and values, + * @param array $attributes an array of attributes keys and values, * @return string attribute string */ public static function generateAttributesStringFromArray($attributes) @@ -618,13 +618,13 @@ class FormSetupItem /** @var string $picto */ public $picto = ''; - /** @var string $fieldValue */ + /** @var ?string $fieldValue */ public $fieldValue; - /** @var string $defaultFieldValue */ + /** @var ?string $defaultFieldValue */ public $defaultFieldValue = null; - /** @var array $fieldAttr fields attribute only for compatible fields like input text */ + /** @var array{name?:string,id?:string,value?:mixed,class?:string,disabled?:?int<0,1>,type?:string,size?:int,placeholder?:string,step?:float|string,min?:int,max?:int} fields attribute only for compatible fields like input text */ public $fieldAttr = array(); /** @var bool|string set this var to override field output will override $fieldInputOverride and $fieldOutputOverride too */ @@ -639,10 +639,10 @@ class FormSetupItem /** @var int $rank */ public $rank = 0; - /** @var array set this var for options on select and multiselect items */ + /** @var array set this var for options on select and multiselect items */ public $fieldOptions = array(); - /** @var array set this var to add more parameters */ + /** @var array set this var to add more parameters */ public $fieldParams = array(); /** @var callable $saveCallBack */ @@ -1513,7 +1513,7 @@ public function setAsTitle() /** * Set type of input as a simple title. No data to store * - * @param array $fieldOptions A table of field options + * @param array $fieldOptions A table of field options * @return self */ public function setAsMultiSelect($fieldOptions) @@ -1529,7 +1529,7 @@ public function setAsMultiSelect($fieldOptions) /** * Set type of input as a simple title. No data to store * - * @param array $fieldOptions A table of field options + * @param array $fieldOptions A table of field options * @return self */ public function setAsSelect($fieldOptions) diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index f4b31370d7d4e..afea3d81e3c09 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.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 @@ -27,6 +28,9 @@ */ class FormWebsite { + /** + * @var DoliDB + */ private $db; /** @@ -35,7 +39,7 @@ class FormWebsite public $error; /** - * var int A number of lines + * @var int A number of lines */ public $num; @@ -251,10 +255,10 @@ public function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0 * @param Website $website Object Website * @param string $htmlname Name of select zone * @param int $pageid Preselected container ID - * @param int $showempty Show empty record + * @param int<0,1> $showempty Show empty record * @param string $action Action on page that use this select list * @param string $morecss More CSS - * @param array $excludeids Exclude some ID in list + * @param null|string[] $excludeids Exclude some ID in list * @return string HTML select component with list of block containers */ public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null) @@ -385,7 +389,7 @@ public function getContentPageTemplate($htmlContent = 'message') $out .= '
'; $out .= ''.$template.''; - $out .= ''.($template != 'text' ? ucfirst($template) : ucfirst($templateFunction)).''; + $out .= ''.($template != 'text' ? ucfirst($template) : ucfirst($templateFunction)).''; $out .= '
'; } $out .= ''; From ee9acfff0ef99db883e9d228700c0f6a2907fabe Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 22 Oct 2024 11:42:28 +0200 Subject: [PATCH 5/8] Qual: Fix phan notices in class files (part 2) --- dev/tools/phan/baseline.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index c5560a35da1e3..bd676828b769a 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -14,10 +14,10 @@ return [ // PhanPluginUnknownPropertyType : 420+ occurrences // PhanTypeMismatchArgumentProbablyReal : 360+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 280+ occurrences - // PhanPluginUnknownArrayMethodParamType : 190+ occurrences - // PhanPossiblyUndeclaredVariable : 190+ occurrences - // PhanTypeMismatchProperty : 160+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 290+ occurrences + // PhanPluginUnknownArrayMethodParamType : 210+ occurrences + // PhanPossiblyUndeclaredVariable : 200+ occurrences + // PhanTypeMismatchProperty : 170+ occurrences // PhanPluginUnknownArrayFunctionParamType : 95+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences // PhanTypeMismatchArgumentNullableInternal : 60+ occurrences @@ -25,6 +25,7 @@ return [ // PhanRedefineFunction : 50+ occurrences // PhanPluginEmptyStatementIf : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences + // PhanPluginUnknownArrayPropertyType : 35+ occurrences // PhanTypeInvalidDimOffset : 35+ occurrences // PhanPluginUnknownArrayPropertyType : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences From 5ee92a936de7e59e48556761c66fd88cbe4b9556 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 22 Oct 2024 16:50:14 +0200 Subject: [PATCH 6/8] Qual: Fix phan notices doleditor...events.class --- dev/tools/phan/baseline.txt | 4 ++-- htdocs/core/class/dolreceiptprinter.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index bd676828b769a..96651f4cc90d5 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -14,10 +14,10 @@ return [ // PhanPluginUnknownPropertyType : 420+ occurrences // PhanTypeMismatchArgumentProbablyReal : 360+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 290+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 280+ occurrences // PhanPluginUnknownArrayMethodParamType : 210+ occurrences // PhanPossiblyUndeclaredVariable : 200+ occurrences - // PhanTypeMismatchProperty : 170+ occurrences + // PhanTypeMismatchProperty : 160+ occurrences // PhanPluginUnknownArrayFunctionParamType : 95+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences // PhanTypeMismatchArgumentNullableInternal : 60+ occurrences diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 6a2d4e131a5be..746d99488e5ea 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -382,7 +382,7 @@ public function listPrintersTemplates() $this->errors[] = $this->db->lasterror; } - $this->listprinterstemplates = $listofprinters; + $this->listprinterstemplates = $listofprinters; // @phpstan-ignore-line return $error; } From 1f084ae61165501b2969fd4db494b07addcb06b7 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 23 Oct 2024 01:37:18 +0200 Subject: [PATCH 7/8] Qual: Fix phan notices defaultvalues...formprojet.class --- dev/tools/phan/baseline.txt | 4 ++-- htdocs/core/class/dolreceiptprinter.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 96651f4cc90d5..96fac45d90d06 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -15,8 +15,8 @@ return [ // PhanTypeMismatchArgumentProbablyReal : 360+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences // PhanPluginUnknownArrayMethodReturnType : 280+ occurrences - // PhanPluginUnknownArrayMethodParamType : 210+ occurrences - // PhanPossiblyUndeclaredVariable : 200+ occurrences + // PhanPluginUnknownArrayMethodParamType : 190+ occurrences + // PhanPossiblyUndeclaredVariable : 190+ occurrences // PhanTypeMismatchProperty : 160+ occurrences // PhanPluginUnknownArrayFunctionParamType : 95+ occurrences // PhanPluginUndeclaredVariableIsset : 65+ occurrences diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 746d99488e5ea..6a2d4e131a5be 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -382,7 +382,7 @@ public function listPrintersTemplates() $this->errors[] = $this->db->lasterror; } - $this->listprinterstemplates = $listofprinters; // @phpstan-ignore-line + $this->listprinterstemplates = $listofprinters; return $error; } From bef9a01be52a269a1e75deb2b471aab4d592ded6 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 23 Oct 2024 12:21:11 +0200 Subject: [PATCH 8/8] Qual: Fix notices formsetup...formwebsite.class --- dev/tools/phan/baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 96fac45d90d06..c5560a35da1e3 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -25,7 +25,6 @@ return [ // PhanRedefineFunction : 50+ occurrences // PhanPluginEmptyStatementIf : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences - // PhanPluginUnknownArrayPropertyType : 35+ occurrences // PhanTypeInvalidDimOffset : 35+ occurrences // PhanPluginUnknownArrayPropertyType : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences