Commit Graph

18 Commits

Author SHA1 Message Date
Laurent Destailleur
4415246d46 Exclude dir for phan 2024-11-14 00:03:31 +01:00
MDW
a703ea1092 Add checks on dol_(mktime|now|print_date) + avoid duplicate phan conf 2024-03-27 10:18:39 +01:00
MDW
2a13f7134c Qual: Add extra phan stubs fixing PhanUndeclaredClassMethod 2024-03-23 14:29:54 +01:00
MDW
686facd74d Fix PhanPluginWhitespaceTrailing + format code + minor spelling 2024-03-17 21:35:08 +01:00
Francis Appels
6f1b184f17 Merge remote-tracking branch 'Dolibarr/develop' into develop_fix_delivery_note 2024-03-12 14:13:41 +01:00
Francis Appels
75e99a6dee Fix phan tool for shipping 2024-03-12 11:21:42 +01:00
Frédéric France
e60db40fa4 clean code and phpdoc 2024-03-11 22:20:29 +01:00
MDW
9c00a465c9 Qual: phan: Add more global definitions (#28745)
* Qual: phan: Add more global definitions

# Qual: phan: Add more global definitions

Add some more typing information for globals

* Qual: phan: ignore local conf file which may contain exceptions

* Qual: phan: add a few more global typings
2024-03-11 12:55:44 +01:00
MDW
3b57795895 Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0) (#28718)
* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* New: Fixer for selectDate '' arguments h, m and empty

* Qual: Update codespell exceptions
2024-03-09 01:04:15 +01:00
Laurent Destailleur
c44f102518 Try to remove phan error 2024-03-08 22:58:15 +01:00
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
MDW
6cce456b8c Qual: Add fixers for price(ARG2), and urlencode((string)...) (#28701)
# Qual: Add fixers for price(ARG2), and urlencode((string)...)

Register the fixers used to fix phan messages by adjusting arguments and casts.
2024-03-08 12:18:22 +01:00
Laurent Destailleur
8528b3f363 Clean conf 2024-03-04 18:33:32 +01:00
Laurent Destailleur
4f3a6d1959 Removed false positive 2024-03-01 01:58:06 +01:00
Laurent Destailleur
dd3415b1ac Fix phan error and remove false alert 2024-02-29 16:41:00 +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
a351bc05e5 New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT (#28447)
* New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT

# New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT

This detects GETPOST calls with second parameter 'int' and can
convert to GETPOSTINT

* New: Fixer for deprecated module names
2024-02-27 14:08:07 +01:00
MDW
1c3a035ae5 Qual: New Phan plugin for testing that argument matches regex (#28424)
* Qual: New Phan plugin for testing that argument matches regex

# Qual: New Phan plugin for testing that argument matches regex

This Plugin - currently applied to GETPOST - allows verifying that a selected
argument of a function matches a regular expression.

* Qual: Add isModEnabled verification to phan

# Qual: Add isModEnabled verification in phan

Using ParamMatchRegexPlugin, add isModEnabled parameter verification.

* Qual: Verify sanitizeVal check value

# Qual: Verify sanitizeVal check value

Use ParamMatchPlugin to check sanitizeVal check value

* Qual: Extend ParamMatchRegexPlugin with class_method

# Qual: Extend ParamMatchRegexPlugin with class_method

Allow matching class methods for argument verification.

* Update config.php

* Qual: New Phan plugin for testing that argument matches regex

# Qual: New Phan plugin for testing that argument matches regex

This Plugin - currently applied to GETPOST - allows verifying that a selected
argument of a function matches a regular expression.

* Qual: Add isModEnabled verification to phan

# Qual: Add isModEnabled verification in phan

Using ParamMatchRegexPlugin, add isModEnabled parameter verification.

* Qual: Verify sanitizeVal check value

# Qual: Verify sanitizeVal check value

Use ParamMatchPlugin to check sanitizeVal check value

* Qual: Extend ParamMatchRegexPlugin with class_method

# Qual: Extend ParamMatchRegexPlugin with class_method

Allow matching class methods for argument verification.

* Report scalar values (see null, etc)

* Qual: Ignore false Phan Notification

* Qual: Ignore false Phan Notification

* Qual: Fix Phan needs specific message keys for coloring.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-26 23:10:16 +01:00