diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 385915e280d..c06023c7b89 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -5451,7 +5451,7 @@ parameters: - message: '#^Variable \$i might not be defined\.$#' identifier: variable.undefined - count: 4 + count: 3 path: ../../../htdocs/compta/facture/card.php - @@ -12060,12 +12060,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -12270,12 +12264,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -12324,12 +12312,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -12522,12 +12504,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -12690,12 +12666,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php - - message: '#^Parameter \#4 \$columnText of method CommonDocGenerator\:\:printStdColumnContent\(\) expects string, float given\.$#' identifier: argument.type @@ -12906,12 +12876,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -13620,12 +13584,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/mailings/xinputuser.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/member/doc/doc_generic_member_odt.class.php - - message: '#^Comparison operation "\>" between 1 and 0 is always true\.$#' identifier: greater.alwaysTrue @@ -13680,18 +13638,6 @@ parameters: count: 2 path: ../../../htdocs/core/modules/modAgenda.class.php - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modCategorie.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modCategorie.class.php - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' identifier: assign.propertyType @@ -13710,60 +13656,12 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modCategorie.class.php - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modCommande.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modCommande.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modCommande.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 3 - path: ../../../htdocs/core/modules/modCommande.class.php - - message: '#^Variable \$user in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../../htdocs/core/modules/modCommande.class.php - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modContrat.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modContrat.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modContrat.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 3 - path: ../../../htdocs/core/modules/modContrat.class.php - - message: '#^Variable \$user in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -13776,48 +13674,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modEventOrganization.class.php - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modExpedition.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modExpedition.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modExpedition.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modExpedition.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 2 - path: ../../../htdocs/core/modules/modExpedition.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modExpedition.class.php - - - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' - identifier: assign.propertyType - count: 7 - path: ../../../htdocs/core/modules/modExpedition.class.php - - message: '#^Variable \$user in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -14424,12 +14280,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -14634,12 +14484,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -14694,12 +14538,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -14778,12 +14616,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -14826,12 +14658,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -15030,12 +14856,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -15072,12 +14892,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/societe/doc/doc_generic_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/societe/doc/doc_generic_odt.modules.php - - message: '#^Variable \$contactstatic might not be defined\.$#' identifier: variable.undefined @@ -15168,12 +14982,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -15336,12 +15144,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -15408,12 +15210,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -15666,12 +15462,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -15816,12 +15606,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php - - message: '#^Variable \$contactobject might not be defined\.$#' identifier: variable.undefined @@ -15834,12 +15618,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/ticket/mod_ticket_simple.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php - - message: '#^Variable \$contactobject might not be defined\.$#' identifier: variable.undefined @@ -15864,12 +15642,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -21498,6 +21270,198 @@ parameters: count: 1 path: ../../../htdocs/imports/import.php + - + message: '#^Class Segment implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Default value of the parameter \#3 \$encode \(true\) of method Segment\:\:setVars\(\) is incompatible with type string\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Method Segment\:\:__call\(\) has parameter \$args with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Method Segment\:\:macroReplace\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Parameter \#3 \$encode of method Segment\:\:setVars\(\) expects string, false given\.$#' + identifier: argument.type + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$children has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$file has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$images has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$name has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$odf has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$vars has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$xml has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Property Segment\:\:\$xmlParsed has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/Segment.php + + - + message: '#^Class SegmentIterator implements generic interface RecursiveIterator but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics + count: 1 + path: ../../../htdocs/includes/odtphp/SegmentIterator.php + + - + message: '#^Method SegmentIterator\:\:__construct\(\) has parameter \$ref with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../../htdocs/includes/odtphp/SegmentIterator.php + + - + message: '#^Method SegmentIterator\:\:getChildren\(\) return type with generic interface RecursiveIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics + count: 1 + path: ../../../htdocs/includes/odtphp/SegmentIterator.php + + - + message: '#^Property SegmentIterator\:\:\$key has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/SegmentIterator.php + + - + message: '#^Property SegmentIterator\:\:\$keys has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/SegmentIterator.php + + - + message: '#^Property SegmentIterator\:\:\$ref has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/SegmentIterator.php + + - + message: '#^Method Odf\:\:__construct\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Method Odf\:\:_getDataFromHtml\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Method Odf\:\:_isHtmlTag\(\) is unused\.$#' + identifier: method.unused + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Method Odf\:\:_replaceHtmlWithOdtTag\(\) has parameter \$customStyles with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Method Odf\:\:_replaceHtmlWithOdtTag\(\) has parameter \$fontDeclarations with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Method Odf\:\:_replaceHtmlWithOdtTag\(\) has parameter \$tags with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Method Odf\:\:getConfig\(\) should return string but returns false\.$#' + identifier: return.type + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Parameter \#1 \$prefix of function uniqid expects string, int\<0, max\> given\.$#' + identifier: argument.type + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Property Odf\:\:\$config has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Property Odf\:\:\$images has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Property Odf\:\:\$segments has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Property Odf\:\:\$userdefined has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + + - + message: '#^Property Odf\:\:\$vars has no type specified\.$#' + identifier: missingType.property + count: 1 + path: ../../../htdocs/includes/odtphp/odf.php + - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -23232,12 +23196,6 @@ parameters: count: 1 path: ../../../htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type @@ -29184,12 +29142,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php - - - message: '#^Parameter \#2 \$config of class Odf constructor expects string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' identifier: argument.type diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 25cb26cb1ad..87115221921 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -1,9 +1,10 @@ - * Copyright (C) 2005-2014 Laurent Destailleur - * Copyright (C) 2012-2016 Juanjo Menent - * Copyright (C) 2020 Stéphane Lesage - * Copyright (C) 2024 MDW +/* Copyright (C) 2005 Matthieu Valleton + * Copyright (C) 2005-2014 Laurent Destailleur + * Copyright (C) 2012-2016 Juanjo Menent + * Copyright (C) 2020 Stéphane Lesage + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Frédéric France * * 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,14 +71,15 @@ class modCategorie extends DolibarrModules $this->langfiles = array("products", "companies", "categories", "members", "stocks", "website"); // Constants - $this->const = array(); - $r = 0; - $this->const[$r][0] = "CATEGORIE_RECURSIV_ADD"; - $this->const[$r][1] = "yesno"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = 'Affect parent categories'; - $this->const[$r][4] = 0; - $r++; + $this->const = [ + [ + "CATEGORIE_RECURSIV_ADD", + "yesno", + "0", + "Affect parent categories", + 0, + ], + ]; // Boxes $this->boxes = array(); diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index bb6d39c9421..e3eb08b5131 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -7,8 +7,8 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2020 Ahmad Jamaly Rabub - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -76,29 +76,29 @@ class modCommande extends DolibarrModules $this->langfiles = array('orders', 'bills', 'companies', 'products', 'deliveries', 'sendings'); // Constants - $this->const = array(); - $r = 0; - - $this->const[$r][0] = "COMMANDE_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "eratosthene"; - $this->const[$r][3] = 'Name of PDF model of order'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "COMMANDE_ADDON"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_commande_marbre"; - $this->const[$r][3] = 'Name of numbering numerotation rules of order'; - $this->const[$r][4] = 0; - - $r++; - $this->const[$r][0] = "COMMANDE_ADDON_PDF_ODT_PATH"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/orders"; - $this->const[$r][3] = ""; - $this->const[$r][4] = 0; - + $this->const = [ + [ + "COMMANDE_ADDON_PDF", + "chaine", + "eratosthene", + "Name of PDF model of order", + 0, + ], + [ + "COMMANDE_ADDON", + "chaine", + "mod_commande_marbre", + "Name of numbering numerotation rules of order", + 0, + ], + [ + "COMMANDE_ADDON_PDF_ODT_PATH", + "chaine", + "DOL_DATA_ROOT/doctemplates/orders", + "", + 0, + ], + ]; /*$r++; $this->const[$r][0] = "COMMANDE_DRAFT_WATERMARK"; $this->const[$r][1] = "chaine"; diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 87178b9a902..879549cabe4 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2024-2025 Frédéric France * 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 * the Free Software Foundation; either version 3 of the License, or @@ -69,29 +69,29 @@ class modContrat extends DolibarrModules $this->config_page_url = array("contract.php"); // Constants - $this->const = array(); - $r = 0; - - $this->const[$r][0] = "CONTRACT_ADDON"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_contract_serpis"; - $this->const[$r][3] = 'Nom du gestionnaire de numerotation des contrats'; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "CONTRACT_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "strato"; - $this->const[$r][3] = 'Name of PDF model of contract'; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "CONTRACT_ADDON_PDF_ODT_PATH"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/contracts"; - $this->const[$r][3] = ""; - $this->const[$r][4] = 0; - $r++; + $this->const = [ + [ + "CONTRACT_ADDON", + "chaine", + "mod_contract_serpis", + "Nom du gestionnaire de numerotation des contrats", + 0, + ], + [ + "CONTRACT_ADDON_PDF", + "chaine", + "strato", + "Name of PDF model of contract", + 0, + ], + [ + "CONTRACT_ADDON_PDF_ODT_PATH", + "chaine", + "DOL_DATA_ROOT/doctemplates/contracts", + "", + 0, + ], + ]; // Boxes $this->boxes = array( diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index cfe141b56eb..9860dc3d086 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013 Philippe Grand - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -62,14 +62,15 @@ class modExpedition extends DolibarrModules $this->picto = "dolly"; // Data directories to create when module is enabled - $this->dirs = array("/expedition/temp", - "/expedition/sending", - "/expedition/sending/temp", - "/expedition/receipt", - "/expedition/receipt/temp", - "/doctemplates/shipments", - "/doctemplates/deliveries" - ); + $this->dirs = array( + "/expedition/temp", + "/expedition/sending", + "/expedition/sending/temp", + "/expedition/receipt", + "/expedition/receipt/temp", + "/doctemplates/shipments", + "/doctemplates/deliveries", + ); // Config pages $this->config_page_url = array("expedition.php"); @@ -81,66 +82,65 @@ class modExpedition extends DolibarrModules $this->langfiles = array('deliveries', 'sendings'); // Constants - $this->const = array(); - $r = 0; - - $this->const[$r][0] = "EXPEDITION_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "espadon"; - $this->const[$r][3] = 'Nom du gestionnaire de generation des bons expeditions en PDF'; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "EXPEDITION_ADDON_NUMBER"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_expedition_safor"; - $this->const[$r][3] = 'Name for numbering manager for shipments'; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipments"; - $this->const[$r][3] = ""; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "DELIVERY_ADDON_PDF"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "storm"; - $this->const[$r][3] = 'Nom du gestionnaire de generation des bons de reception en PDF'; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "DELIVERY_ADDON_NUMBER"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_delivery_jade"; - $this->const[$r][3] = 'Nom du gestionnaire de numerotation des bons de reception'; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "DELIVERY_ADDON_PDF_ODT_PATH"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries"; - $this->const[$r][3] = ""; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "MAIN_SUBMODULE_EXPEDITION"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "1"; - $this->const[$r][3] = "Enable delivery receipts"; - $this->const[$r][4] = 0; - $r++; - + $this->const = [ + [ + "EXPEDITION_ADDON_PDF", + "chaine", + "espadon", + 'Nom du gestionnaire de generation des bons expeditions en PDF', + 0, + ], + [ + "EXPEDITION_ADDON_NUMBER", + "chaine", + "mod_expedition_safor", + 'Name for numbering manager for shipments', + 0, + ], + [ + "EXPEDITION_ADDON_PDF_ODT_PATH", + "chaine", + "DOL_DATA_ROOT/doctemplates/shipments", + "", + 0, + ], + [ + "DELIVERY_ADDON_PDF", + "chaine", + "storm", + 'Nom du gestionnaire de generation des bons de reception en PDF', + 0, + ], + [ + "DELIVERY_ADDON_NUMBER", + "chaine", + "mod_delivery_jade", + 'Nom du gestionnaire de numerotation des bons de reception', + 0, + ], + [ + "DELIVERY_ADDON_PDF_ODT_PATH", + "chaine", + "DOL_DATA_ROOT/doctemplates/deliveries", + "", + 0, + ], + [ + "MAIN_SUBMODULE_EXPEDITION", + "chaine", + "1", + "Enable delivery receipts", + 0, + ], + ]; // Boxes $this->boxes = array( - 0=>array('file'=>'box_shipments.php', 'enabledbydefaulton'=>'Home'), + 0 => array('file'=>'box_shipments.php', 'enabledbydefaulton'=>'Home'), ); // Permissions - $this->rights = array(); $this->rights_class = 'expedition'; + $this->rights = array(); $r = 0; $r++; diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index 85789ee8017..3e8675c65a9 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -64,6 +64,7 @@ class Segment implements IteratorAggregate, Countable * * @return int */ + #[\ReturnTypeWillChange] public function count() { return count($this->children); @@ -73,6 +74,7 @@ class Segment implements IteratorAggregate, Countable * * @return Iterator */ + #[\ReturnTypeWillChange] public function getIterator() { return new RecursiveIteratorIterator(new SegmentIterator($this->children), 1); @@ -165,7 +167,7 @@ class Segment implements IteratorAggregate, Countable * * Miguel Erill 09/04/2017 * - * @param string $value String to convert + * @param string $text String to convert */ public function macroReplace($text) { diff --git a/htdocs/includes/odtphp/SegmentIterator.php b/htdocs/includes/odtphp/SegmentIterator.php index 8fc2f27087f..96c931c4d2e 100644 --- a/htdocs/includes/odtphp/SegmentIterator.php +++ b/htdocs/includes/odtphp/SegmentIterator.php @@ -12,36 +12,50 @@ class SegmentIterator implements RecursiveIterator { private $ref; private $key; + private $keys; public function __construct(array $ref) { $this->ref = $ref; $this->key = 0; $this->keys = array_keys($this->ref); } + #[\ReturnTypeWillChange] public function hasChildren() { return $this->valid() && $this->current() instanceof Segment; } + #[\ReturnTypeWillChange] public function current() { return $this->ref[$this->keys[$this->key]]; } + #[\ReturnTypeWillChange] function getChildren() { return new self($this->current()->children); } + #[\ReturnTypeWillChange] public function key() { return $this->key; } + #[\ReturnTypeWillChange] public function valid() { return array_key_exists($this->key, $this->keys); } + /** + * @return void + */ + #[\ReturnTypeWillChange] public function rewind() { $this->key = 0; } + /** + * @return void + */ + #[\ReturnTypeWillChange] public function next() { $this->key ++; diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index c920f319621..1198d667c61 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -36,21 +36,59 @@ class Odf 'DELIMITER_RIGHT' => '}', 'PATH_TO_TMP' => '/tmp' ); + /** + * @var PclZipProxy|PhpZipProxy + */ protected $file; - protected $contentXml; // To store content of content.xml file - protected $metaXml; // To store content of meta.xml file - protected $stylesXml; // To store content of styles.xml file - protected $manifestXml; // To store content of META-INF/manifest.xml file + + /** + * @var string To store content of content.xml file + */ + protected $contentXml; + + /** + * @var string To store content of meta.xml file + */ + protected $metaXml; + + /** + * @var string To store content of styles.xml file + */ + protected $stylesXml; + + /** + * @var string To store content of META-INF/manifest.xml file + */ + protected $manifestXml; + + /** + * @var string + */ protected $tmpfile; - protected $tmpdir=''; + + /** + * @var string + */ + protected $tmpdir = ''; protected $images = array(); protected $vars = array(); protected $segments = array(); + /** + * @var string + */ public $creator; + + /** + * @var string + */ public $title; + + /** + * @var string + */ public $subject; - public $userdefined=array(); + public $userdefined = array(); const PIXEL_TO_CM = 0.026458333; const FIND_TAGS_REGEX = '/<([A-Za-z0-9]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/s'; @@ -61,7 +99,7 @@ class Odf * Class constructor * * @param string $filename The name of the odt file - * @param string $config Array of config data + * @param array $config Array of config data * @throws OdfException */ public function __construct($filename, $config = array()) @@ -566,13 +604,11 @@ IMG; $matches = array(); preg_match_all($reg, $xml, $matches, PREG_SET_ORDER); - //var_dump($this->vars);exit; foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it if (! empty($match[1]) && ! isset($this->vars[$match[1]])) { $this->vars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop } } - //var_dump($this->vars);exit; // Conditionals substitution // Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 02dcc1ce6af..fcff7afc7d6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -230,15 +230,13 @@ $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than curren $urlok = $urlwithroot.'/public/payment/paymentok.php?'; $urlko = $urlwithroot.'/public/payment/paymentko.php?'; -/* -if ($ws) { +if ($ws && !defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { // So defined('USEEXTERNALSERVER') should be set but is not always include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; $tmpwebsite = new WebSite($db); $tmpwebsite->fetch(0, $ws); $urlok = $tmpwebsite->virtualhost.'/public/payment/paymentok.php?'; $urlko = $tmpwebsite->virtualhost.'/public/payment/paymentko.php?'; } -*/ // Complete urls for post treatment $ref = $REF = GETPOST('ref', 'alpha'); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index b70871bdf2d..dc3f59c86c6 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -5,7 +5,7 @@ * Copyright (C) 2021-2023 Waël Almoman * Copyright (C) 2021 Maxime Demarest * Copyright (C) 2021 Dorian Vabre - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -174,6 +174,7 @@ $error = 0; // Check if we have redirtodomain to do. $ws_virtuelhost = null; +$doactionsthenredirect = 0; if ($ws) { $doactionsthenredirect = 1; include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 075cc668cca..377e432596a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -26,7 +26,27 @@ parameters: - htdocs/modulebuilder/template/test/* - htdocs/support/* analyse: - - htdocs/includes/* + - htdocs/includes/geoPHP/* + - htdocs/includes/markrogoyski/* + - htdocs/includes/maximebf/* + - htdocs/includes/mike42/* + - htdocs/includes/mobiledetect/* + - htdocs/includes/nusoap/* + - htdocs/includes/OAuth/* + - htdocs/includes/odtphp/zip/* + - htdocs/includes/parsedown/* + - htdocs/includes/php-iban/* + - htdocs/includes/phpoffice/* + - htdocs/includes/printipp/* + - htdocs/includes/Psr/* + - htdocs/includes/restler/* + - htdocs/includes/sabre/* + - htdocs/includes/stripe/* + - htdocs/includes/swiftmailer/* + - htdocs/includes/symfony/* + - htdocs/includes/tcpdi/* + - htdocs/includes/tecnickcom/* + - htdocs/includes/webklex/* - htdocs/core/class/lessc.class.php # checkAlwaysTrueCheckTypeFunctionCall: false # checkAlwaysTrueInstanceof: false