Commit Graph

200 Commits

Author SHA1 Message Date
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
MDW
a408288ba1 Fix & enable PhanPluginUnknownClosureParamType
# Fix & enable PhanPluginUnknownClosureParamType

Typing of anonymous functions to fix this notice.
Optimised some minor things.
2024-03-14 22:42:26 +01:00
MDW
88d59896ec Qual: 'enabled' in fields can be string ('isModEnabled(...)')
# Qual: 'enabled' in fields can be string ('isModEnabled(...)')

Update PHPdoc to allow that enabled is a string
2024-03-12 13:38:08 +01:00
MDW
c58a2db86b Fix: Repeat fields typing in CommonClass children
# Fix: Repeat fields typing in CommonClass children

phpstan needs typing to be 'co-variant' and therefore typing must be repeated as
the method is not to initialise the property in the constructor, but to override
the proparty by a 'local' definition in the child class
2024-03-11 17:40:33 +01:00
MDW
13fcaf19f2 Fix: Repeat fields typing in CommonClass children
# Fix: Repeat fields typing in CommonClass children

phpstan needs typing to be 'co-variant' and therefore typing must be repeated as
the method is not to initialise the property in the constructor, but to override
the proparty by a 'local' definition in the child class
2024-03-11 17:40:31 +01:00
Laurent Destailleur
5c80d4b4fd CSS 2024-03-05 15:43:11 +01:00
Frédéric FRANCE
fe0123262d fix phpstan (#28401)
Property ProductCombinationLevel::$fk_product_attribute_combination (int) does not accept float.
2024-02-25 10:00:58 +01:00
thibdrev
c93905cf81 qual: phpstan for htdocs/variants/class/ProductAttribute.class.php (#28122)
htdocs/variants/class/ProductAttribute.class.php	1401	Parameter #7 $seller (string) of method ProductAttribute::printObjectLine() should be compatible with parameter $seller (Societe) of method CommonObject::printObjectLine()
htdocs/variants/class/ProductAttribute.class.php	1401	Parameter #8 $buyer (string) of method ProductAttribute::printObjectLine() should be compatible with parameter $buyer (Societe) of method CommonObject::printObjectLine()
2024-02-12 02:06:42 +01:00
kkhelifa-opendsi
dbb8861a98 NEW: Sort variants list by product ref on combinations page (#27969) 2024-02-02 17:45:30 +01:00
thibdrev
5a15ff9931 qual: phpstan for htdocs/variants/class/ProductAttribute.class.php
htdocs/variants/class/ProductAttribute.class.php	1315	Parameter #2 $seller (string) of method ProductAttribute::printObjectLines() should be compatible with parameter $seller (Societe) of method CommonObject::printObjectLines()

htdocs/variants/class/ProductAttribute.class.php	1315	Parameter #3 $buyer (string) of method ProductAttribute::printObjectLines() should be compatible with parameter $buyer (Societe) of method CommonObject::printObjectLines()

htdocs/variants/class/ProductAttribute.class.php	1401	Parameter #7 $seller (string) of method ProductAttribute::printObjectLine() should be compatible with parameter $seller (Societe) of method CommonObject::printObjectLine()

htdocs/variants/class/ProductAttribute.class.php	1401	Parameter #8 $buyer (string) of method ProductAttribute::printObjectLine() should be compatible with parameter $buyer (Societe) of method CommonObject::printObjectLine()
2024-01-25 12:03:22 +01:00
MDW
39769482b1 Qual: Fix typing hints for DoliDB (#27484)
# Qual: Fix typing hints for DoliDB

This should help the static tools for type and method checking.
2024-01-13 15:50:02 +01:00
MDW
342ab85195 Qual: Spelling htdocs/[q-z]* (#27447)
# Qual: Fix spelling htdocs/[q-z]*

Probably fixes a bug:

- htdocs/webservices/server_thirdparty.php
  No other occurence of adress found.
  -'adress'=>->adress,- +'address'=>->address,+
2024-01-12 17:18:52 +01:00
Laurent Destailleur
b28ae5d8d3 Clean code 2023-12-27 12:12:20 +01:00
Frédéric FRANCE
61b79fda17 avoid phpstan error with phpdoc 2023-12-06 15:46:39 +01:00
Laurent Destailleur
619155f65e Fix with php-cs-fixer 2023-12-04 13:53:48 +01:00
Frédéric FRANCE
53c8a3acf8 clean phpdoc for phpstan (#26905) 2023-12-01 19:51:32 +01:00
Laurent Destailleur
075ee02901 Fix php8.2 warnings 2023-11-27 12:08:48 +01:00
Laurent Destailleur
e910c3fa4e CSS 2023-11-16 15:14:01 +01:00
Laurent Destailleur
b65d5c8740 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop 2023-11-05 19:52:54 +01:00