Commit Graph

218 Commits

Author SHA1 Message Date
Laurent Destailleur
7e8fff6cb0 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-11-10 18:28:05 +01:00
Francis Appels
e17eafacb2 FIX select variant by attribute. (#31759)
DISTINCT needs order field in select.
Solved by removing DISTINCT
2024-11-10 18:15:04 +01:00
MDW
278d301f32 Qual: Fix phan/phpstan notices in class files (part 6) (#31634)
* Qual: Fix notices for paymentdonation...workstationusergroup.class

* Qual: Fix PhanPluginRedundantReturnComment, update baseline

* Qual: Complete array phpdoc for properties
2024-11-06 23:57:45 +01:00
Frédéric FRANCE
6dd6ab7906 fix phpstan (#31614)
* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan
2024-10-29 17:40:56 +01:00
Frédéric FRANCE
0b1d243a7a add translations count (#31398) 2024-10-15 15:39:29 +02:00
Laurent Destailleur
046166f483 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-10-14 21:38:12 +02:00
Laurent Destailleur
916014707d Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2024-10-14 21:18:24 +02:00
Frédéric FRANCE
820333b02f fix variants sql init (#31319)
* fix variants sql init

* add setup

* add setup

* add setup

* update class

* update list

* update list

* update list

* update class

* fix typos

* fix translations

* fix html

* fix update

* fix sql

* fix extrafields

* fix extrafields
2024-10-13 21:08:55 +02:00
MDW
c62e015410 Qual: Fix (propal|facture|contrat|fichinter)/card, commonobject, files.lib/card_presend.tpl (#31087)
# Qual: Fix (propal|facture|contrat|fichinter)/card, commonobject, files.lib/card_presend.tpl

Fix phan notices in these files

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-09-26 23:01:02 +02:00
Laurent Destailleur
fef73cc6e0 Fix remove not used code 2024-09-01 14:47:31 +02:00
Laurent Destailleur
95f86172d2 Fix CTI error 2024-08-31 19:46:00 +02:00
Laurent Destailleur
650ecc23bd Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-08-31 12:14:06 +02:00
Laurent Destailleur
bc21b973ca Debug v20 2024-08-31 11:45:42 +02:00
Laurent Destailleur
dcfaae3bd5 Clean code: fight against global vars 2024-08-27 06:20:04 +02:00
MDW
ca414de526 Qual: Fix $fields related notices with Phan (#30704)
* Qual: Typing hints/ignore directives for phan notices

* Update field typing
2024-08-21 13:23:35 +02:00
MDW
b0087aaf61 Qual: Enable phan on modulebuilder (#30652)
* Allow null for buyer, and force '' for  in printObjectLine(s)

* Allow null for Contact in show_actions_done

* Qual: Enable phan on modulebuilder

# Qual: Enable phan on modulebuilder

Most files of the modulebuilder template can be checked as regular files.
It will help improve the template

* Update baseline (enable modulebuilder notices)

* Add properties that are expected to exist on modules_boxes

* Qual: Ignore false positive (phan)

* Set phpdoc type to include null on formAddObjectLine

* Qual: Fixes for modulebuilder (phan, phpstan, bugs, format)

* Fix phpcs for intracom

* Make ModeleBoxes:showBox() signature match child class's

* Fix *box::showBox() phpdoc types

* Update index.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-18 18:16:08 +02:00
MDW
54880f92cd Qual: Fix PhanTypeMismatchProperty and some other phan notices (#30542)
* Qual: Fix PhanTypeMismatchProperty and some other phan notices

* Qual: Phan fixes for BOM

* Phan - fix fields

* fixup! Qual: Phan fixes for BOM

* Fix phpstan double array keys for syslog

* Fix $fields phpdoc

* Fix phan typing issues with intermediate var and ??

* Fix phan typing issue with ?? operator

* Ignore htdocs/install/install.forced.php for git

* Qual: Revert to original code, ignore notice

When changing the method to avoid one notice type, another one
appears.  So simply ignoring this error.

* Qual: Revert to original code, ignore notice

When changing the method to avoid one notice type, another one
appears.  So simply ignoring this error.

* Update baseline

* Qual: Phan fixes for BOM

* fixup! Qual: Phan fixes for BOM

* Fix phpstan double array keys for syslog

* Qual: Revert to original code, ignore notice

When changing the method to avoid one notice type, another one
appears.  So simply ignoring this error.

* Ignore PhanTypeSuspiciousNonTraversableForeach to allow integration

* Fix typing hints (phpstan)

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-15 17:05:00 +02:00
MDW
3d04a7195c Qual: Updates regarding write_file(s) methods for Phan (#30511)
* Fix phpdoc for phpstan

* Add abstract write_file to ModelePDFContract

And update phpdoc for derived classes

* Fix typing for php_standard_actions writefile

* Improve phpdoc for write_files (& related)

* Add abstract write_file to ModelePDFBom

* Add abstract write_file to ModelePDFDeliveryOrder

* Add abstract write_file to ModeleExpenseReport

* Add abstract write_file to ModelePDFFicheinter

* Add abstract write_file to ModelePDFEvaluation

* Add abstract write_file to ModelePDFFactures

* Add abstract write_file to ModelePDFSuppliersInvoices

* Update ModelePDFProjects and ModelePDFTask related classes

* Qual: Add abstract write_file to ModelePdfExpedition

And update phpdoc for derived classes

* Qual: Correct reference (doc) to ModelePDFEvaluation

* Qual: Add abstract write_file to ModelePDFKnowledgeRecord

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFMo & ModelePDFMouvement

And update phpdoc for derived classes

* Qual: Set typehint to ModelePDFFicheinter

* Qual: Add abstract write_file to ModelePDFCommandes

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFPropales

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePdfReception

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSuppliersOrders

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSuppliersOrders

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSuppliersPayments

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSupplierProposal

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFWorkstation

And update phpdoc for derived classes

* Set typing for doc generator (commonobject)

* Improve typing for write_file

* Set typing for doc generator

* Qual: Add abstract write_file to ModelePDFMember

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFProduct

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFProductBatch

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFRecruitmentJobPosition

And update phpdoc for derived classes

* Add abstract write_file to ModelePDFTicket

* Add abstract write_file to ModelePDFUser

* Add abstract write_file to ModelePDFUserGroup

* Add abstract write_file to ModeleThirdPartyDoc

* Add abstract write_file to ModelePDFAsset

* Find all incompatible classes

* Qual: update phan baseline

* Set typing for doc generator (commonobject)

* Qual: update phan baseline

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-14 19:21:10 +02:00
MDW
6a98adcc3c Qual: Further phpdoc fixes for phpstan (#30506)
* Fix int<0> typing to int<0,0> for phpstan

* Fix phpdoc for phpstan

* Fix phpdoc for phpstan

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-01 13:25:01 +02:00
MDW
46eb5f83c2 Qual: Updates for phpstan notices (#30509)
* Fix int<0> typing to int<0,0> for phpstan

* Fix phpdoc for phpstan

* Fix phpdoc for phpstan

* Qual: Several phpstan notice fixes

* Fix phpdoc

* Qual: totalpaid is never null, remove null test

* improve phpdoc typing

* Also return null to statisfy phpstan

* Allow null value for $var

* object->Object to make it meaningful

* Type EvalMathStack properties

* Comment out unused private methods (phpstan)

* Changes for phpstan (return values, phpdoc, code)

* Change order of tests for phpstan

* phpdoc object to Object for correct typing

* Typing hing for phpstan

* UPdate test for phpstan

* Change phpdoc position for phpstan

* Update phpdoc for phpstan

This needs further improvement

* Change $op to $ope to fix phpstan

* Update sqlite3.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-01 12:59:45 +02:00
Frédéric FRANCE
173dc1a70e fix constructor expects int (#30512)
* constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

* fix constructor expects int

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-01 10:52:53 +02:00
Laurent Destailleur
2068f29b44 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-08-01 10:51:25 +02:00
Laurent Destailleur
6210c2429a Fix phan 2024-08-01 10:50:52 +02:00
Laurent Destailleur
871e01d955 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-07-31 14:32:55 +02:00
Laurent Destailleur
32d3424423 Fix warning 2024-07-31 14:29:42 +02:00
Laurent Destailleur
d2bd6a03ec Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-07-31 13:21:02 +02:00
Laurent Destailleur
2f7a252244 Fix warnings 2024-07-31 13:09:10 +02:00
thibdrev
9b6586ea64 qual: phpdoc for ProductCombination.class.php (#30105)
* qual: phpdoc for ProductCombination.class.php

* use array_map to cast array values upstream

* phpdoc

* fix phan warning

Avoid function calls in a FOR loop test part
2024-06-22 15:40:26 +02:00
thibdrev
57c75aa350 qual: phpdoc for htdocs/variants/class/ProductAttributeValue.class.php (#30050)
* qual: phpdoc for htdocs/variants/class/ProductAttributeValue.class.php

htdocs/variants/class/ProductAttributeValue.class.php	78	Plugin PhanPluginUnknownPropertyType Property \ProductAttributeValue->id has an initial type that cannot be inferred

htdocs/variants/class/ProductAttributeValue.class.php	79	Plugin PhanPluginUnknownPropertyType Property \ProductAttributeValue->fk_product_attribute has an initial type that cannot be inferred

htdocs/variants/class/ProductAttributeValue.class.php	80	Plugin PhanPluginUnknownPropertyType Property \ProductAttributeValue->ref has an initial type that cannot be inferred

htdocs/variants/class/ProductAttributeValue.class.php	81	Plugin PhanPluginUnknownPropertyType Property \ProductAttributeValue->value has an initial type that cannot be inferred

htdocs/variants/class/ProductAttributeValue.class.php	82	Plugin PhanPluginUnknownPropertyType Property \ProductAttributeValue->position has an initial type that cannot be inferred

* phpcs

* better wording

* phpcs
2024-06-17 13:22:47 +02:00
thibdrev
b14d20bc4c qual fix PHAN warning when using $product->fetch($id) with $id not being an integer (#30019)
* qual fix phan warning on $object->fetch('')

TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($id) is '' of type '' but \Product::fetch() takes int (no real type) defined at htdocs/product/class/product.class.php:2540 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/variants/class/ProductCombination.class.php	773

* Update api_categories.class.php

* Update api_categories.class.php

* Update api_products.class.php

* Update api_products.class.php

* Update combinations.php
2024-06-15 15:53:36 +02:00
thibdrev
dd66a407e4 qual: fix PHAN warnings for ProductCombination.class.php (#30020)
htdocs/variants/class/ProductCombination.class.php	843	TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string

htdocs/variants/class/ProductCombination.class.php	843	TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string

htdocs/variants/class/ProductCombination.class.php	846	TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string

htdocs/variants/class/ProductCombination.class.php	846	TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string

htdocs/variants/class/ProductCombination.class.php	851	TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string

htdocs/variants/class/ProductCombination.class.php	851	TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string
2024-06-15 15:01:40 +02:00
Frédéric FRANCE
facb1930a7 fix phpstan Property Product::$oldcopy in empty() is not falsy (#30003)
* fix phpstan Property Product::$oldcopy in empty() is not falsy

* add token

* doc

* fix phpstan Property Product::$oldcopy in empty() is not falsy

* fix phpstan Property Product::$oldcopy in empty() is not falsy

* fix phpstan
2024-06-13 08:11:11 +02:00
Frédéric FRANCE
d0830b3159 fix phpstan (#29602)
* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix travis

* fix phpstan

* fix phpstan

* fix phan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

fix phpstan

fix phpstan

fix phpstan

fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix travis

* fix phpstan

* fix phpstan

* fix phpstan

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-05-05 00:34:19 +02:00
thibdrev
bc6c31cba4 qual: phpstan for ProductCombination.class.php (#29518)
* qual: phpstan for ProductCombination.class.php

htdocs/variants/class/ProductCombination.class.php	725	Method ProductCombination::getUniqueAttributesAndValuesByFkProductParent() should return array<ProductAttributeValue> but returns array<int<0,max>,stdClass>.

* Update ProductCombination.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-04-28 17:36:25 +02:00
thibdrev
03a4d7bcce phpdoc (#29474) 2024-04-27 04:20:55 +02:00
thibdrev
52e195fe17 phpdoc (#29480) 2024-04-27 04:20:26 +02:00
thibdrev
30b9b71396 phpdoc (#29481) 2024-04-27 04:19:35 +02:00
Frédéric FRANCE
64508a3909 fix phpstan (#29397) 2024-04-20 22:45:52 +01:00
Laurent Destailleur
fd9475be03 Use same doc comment eveywhere. 2024-04-07 12:26:27 +02:00
Laurent Destailleur
38fb00489d PHPDoc 2024-04-05 13:44:59 +02:00
MDW
df0e663c13 Improve fetAllByProductAttribute phpdoc return type 2024-03-29 18:26:47 +01:00
MDW
0ccdbfe147 Correct/improve phpdoc typing 2024-03-29 18:26:45 +01:00
Laurent Destailleur
7b0177a84d Move to getDolGlobalString 2024-03-22 00:37:56 +01:00
MDW
4625a6eaaa Fix arg type for trim with cast 2024-03-20 04:10:04 +01:00
MDW
fd9d48faac Fix phpstan CommonObject->fields - notnull is optional field 2024-03-19 00:32:00 +01:00
MDW
551eaa115c Fix & enable PhanPluginUnknownClosureReturnType
# Fix & enable PhanPluginUnknownClosureReturnType

Fix last PhanPluginUnknownClosureReturnType & enable the notice as
all are fixed
2024-03-17 00:10:18 +01:00
MDW
b28a17ee51 Fix Assign to error as string, not to error as array 2024-03-15 10:11:54 +01:00
MDW
23785393a3 Add csslist to json keys 2024-03-15 03:55:52 +01:00
MDW
e8f49e9bf8 Fix PhanTypeMismatchPropertyDefault 2024-03-15 03:54:14 +01:00
MDW
4aa0ccd870 Fix PhanTypeMismatchPropertyDefault 2024-03-15 03:54:14 +01:00