Commit Graph

3985 Commits

Author SHA1 Message Date
MDW
3d0a85608b Qual: Fix and enable alias deprecation detection (#28716)
* Qual: Ignore some false positives for deprecated functions

# Qual: Ignore some false positives for deprecated functions

The Phan Deprecation Plugin for internal functions has mixed up some
mail functions and lists them as deprecated, this ignores that

* Qual: Enable detection and fixing of internal deprecations

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Replace 'join' with 'implode'

* Qual: Update codespell lines ignore list after format

# Qual: Update codespell lines ignore list after forma

Done using latest library, so also adds some exceptions that are needed
in the future;

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-03-08 21:34:18 +01:00
John BOTELLA
c4cb7c0a98 Add cache feature on fetchObjectByElement 2024-03-08 16:55:53 +01:00
Can Arslan
e74e638b26 FIX: skip adding tab if user doesn't have permission (#28698)
verifCond function checks whether user has right and we should skip adding it if user doesn't have right
2024-03-08 12:28:31 +01:00
John BOTELLA
d1c980b0be Factoring fetchObjectLinked 2024-03-08 11:57:07 +01:00
John BOTELLA
076a009554 Merge branch 'develop' into fix_element_type_part_03 2024-03-08 10:46:35 +01:00
MDW
79adb60cf5 Qual: Add instanceof tests to help static typing analysis (#28696)
# Qual: Add instanceof tests to help static typing analysis

Added instanceof tests to help identify that properties exist.
2024-03-07 23:09:25 +01:00
Laurent Destailleur
1d77e34daf Merge branch 'develop' into fix_element_type_part_03 2024-03-07 20:33:17 +01:00
thibdrev
e2026a1c14 qual: phan for functions.lib.php (#28654)
6 entries for:

TypeError PhanTypeMismatchArgumentProbablyReal Argument 5 ($objcon) is null of type null but \show_actions_messaging() takes \Contact|string (no real type) defined at htdocs/core/lib/functions.lib.php:13081
2024-03-07 20:23:45 +01:00
thibdrev
b9c843c086 qual: phan for functions.lib.php (#28653)
* qual: phan for functions.lib.php

54 entries for:

TypeError PhanTypeMismatchArgumentProbablyReal Argument 3 ($exclude) is null of type null but \getCommonSubstitutionArray() takes array (no real type) defined at htdocs/core/lib/functions.lib.php:8285

* phpcs
2024-03-07 16:55:12 +01:00
MDW
38e69184d1 Fix typing hints (#28676) 2024-03-07 16:04:39 +01:00
Laurent Destailleur
2d9801ffe3 Fix sec more complete list of forbidden function 2024-03-06 17:18:46 +01:00
Laurent Destailleur
c0ee90aa7d Exclude require, include into dol_eval 2024-03-06 17:13:05 +01:00
Laurent Destailleur
7866ee472b QUAL Clean code around dol_eval use 2024-03-06 17:07:24 +01:00
ATM john
a644adbfe5 New hook for getElementProperties 2024-03-06 15:57:34 +01:00
Laurent Destailleur
f9a2c8ec5d Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-06 15:08:21 +01:00
Laurent Destailleur
f1aa29507a Fix sec more complete list of forbidden function 2024-03-06 15:01:25 +01:00
thibdrev
2664661afc qual: phan for htdocs/core/lib/functions.lib.php (#28640)
68 entries for "Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299"

Examples (first 10):

htdocs/accountancy/admin/categories.php	155	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/accountancy/admin/categories.php	189	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/accountancy/bookkeeping/card.php	778	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/admin/eventorganization.php	341	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/admin/hrm.php	596	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/admin/hrm.php	603	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/admin/hrm.php	627	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/admin/knowledgemanagement.php	293	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/admin/knowledgemanagement.php	300	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)

htdocs/admin/multicurrency.php	115	TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($mesg) is null of type null but \setEventMessages() takes string (no real type) defined at htdocs/core/lib/functions.lib.php:9299 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
2024-03-05 16:32:40 +01:00
Laurent Destailleur
d7f3feba74 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-03-05 04:00:09 +01:00
Laurent Destailleur
cda8a7d241 css 2024-03-05 03:57:56 +01:00
Laurent Destailleur
c544efec7f QUAL: Remove use of customurl filter. Must use the USF syntax. 2024-03-05 03:51:36 +01:00
Laurent Destailleur
ce010a54c7 Clean code and prepare a more powerfull phpunit check for sql forging. 2024-03-05 00:22:12 +01:00
Frédéric FRANCE
7090af2b51 fix phpstan (#28609)
* fix phpstan

* Update emailsenderprofile.class.php
2024-03-04 18:27:20 +01:00
Laurent Destailleur
61dd78b95e Fix regression. Removed bad fixer. GETPOST(... int) is not GETPOSTINT 2024-03-04 17:49:43 +01:00
Laurent Destailleur
8930bf83a9 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-03 20:59:45 +01:00
Laurent Destailleur
301bec664a Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-03-03 19:59:34 +01:00
Laurent Destailleur
1e00cf34d4 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-03-03 19:50:22 +01:00
Laurent Destailleur
17ff0972ab Fix use of invoke into computed fields 2024-03-03 19:35:37 +01:00
Frédéric FRANCE
6f58a45220 fix phpstan (#28605)
* fix phpstan

* fix phpstan

* fix too few parameters

* fix typo

* ActionComm::$ref is not covariant with PHPDoc type string

* fix default values
2024-03-03 18:55:30 +01:00
Frédéric FRANCE
f5c0cfcf6b fix phpstan (#28588) 2024-03-03 17:09:55 +01:00
Frédéric FRANCE
e1b3a639c4 fix phpstan default value is incompatible with type string (#28592) 2024-03-03 17:09:24 +01:00
Frédéric FRANCE
3663b9b305 fix phpstan (#28589)
* fix phpstan

* Update functions.lib.php
2024-03-03 17:00:06 +01:00
Laurent Destailleur
21feee3bc8 FIX Better test on validity of compute field syntax with parenthesis 2024-03-03 13:11:54 +01:00
Frédéric FRANCE
cc1199664c fix default value is incompatible with type string (#28584) 2024-03-02 19:19:18 +01:00
Laurent Destailleur
e12c235185 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-02 16:52:44 +01:00
Frédéric FRANCE
074041d925 fix default value is incompatible with int (#28579) 2024-03-02 16:37:53 +01:00
Laurent Destailleur
2044a133e9 Fix warning 2024-03-02 13:15:20 +01:00
Frédéric FRANCE
d0e6933b6d fix phpstan (#28567) 2024-03-02 12:39:30 +01:00
Laurent Destailleur
4279478acd Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-03-01 19:40:36 +01:00
Laurent Destailleur
24397000fe Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-03-01 18:16:31 +01:00
Laurent Destailleur
17015095aa Add option to allow better compatibility with computed fields using
unsecured chars
2024-03-01 18:15:58 +01:00
Regis Houssin
0ac22e1f75 FIX avoid warning "error parsing attribute name in Entity" (#28543) 2024-03-01 12:49:35 +01:00
Laurent Destailleur
7722f0e7d4 Fix syntax error 2024-03-01 01:11:41 +01:00
Laurent Destailleur
eae14a4022 Fix test on country similarty for MQ and GP 2024-02-29 23:45:02 +01:00
Laurent Destailleur
a562452832 Try to restore consistency into isModEnabled. The array must contains
old name -> new name
2024-02-29 15:45:27 +01:00
Laurent Destailleur
a365800967 CSS 2024-02-29 02:57:13 +01:00
MDW
7391ad42ed Qual: Enable detection of deprecated modulename & GETPOST(...,'int') (#28457)
* Qual: Enable detection of deprecated modulename & GETPOST(...,'int')

# Qual: Enable detection of deprecated modulename & GETPOST(...,'int')

Enable phan rules to verify deprecated modulename usage and GETPOST(...,'int')
usage in the code.

* Qual: Try type hint on  to help avoid notification

* Qual: Accept 3 parameters for GETPOST to GETPOSTINT conversion

* Qual: Convert GETPOST(...,'int',VALUE) to GETPOSTINT(...,VALUE)

# Qual: Convert GETPOST(...,'int',VALUE) to GETPOSTINT(...,VALUE)

Following the update to the fixer to also convert GETPOST... with 3 parameters.
The files are now converted.
2024-02-28 23:25:16 +01:00
MDW
1b4a1510ec Modify module mapping principle (#28511) 2024-02-28 22:47:28 +01:00
Frédéric FRANCE
eb6aa92359 fix isModEnabled for all case (#28465)
* Update conf.class.php

* new test

* new test

* new test

* ficheinter not fichinter
2024-02-28 21:43:23 +01:00
Laurent Destailleur
6c5855c99f Clean code 2024-02-28 20:07:26 +01:00
MDW
0b2ce5c2ae Fix: author email (#28479) 2024-02-28 16:07:46 +01:00