2
0
forked from Wavyzz/dolibarr
Commit Graph

38 Commits

Author SHA1 Message Date
Laurent Destailleur
b494d26f95 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-07-25 14:51:48 +02:00
Laurent Destailleur
5c9b808f3f Fix phan 2024-07-25 10:44:43 +02:00
Laurent Destailleur
8f5b98be43 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-06-25 13:50:27 +02:00
Laurent Destailleur
92bc6c9102 Eclude some phan warnings 2024-06-25 12:10:47 +02:00
Laurent Destailleur
ec25b85e35 Exclude more phan warnings 2024-06-21 17:27:52 +02:00
Laurent Destailleur
eb537088ba Exclude phan error type that is for the moment too annoying to manage 2024-06-18 19:15:29 +02:00
Laurent Destailleur
8971c8efac Exclude phan rule 2024-06-03 21:30:25 +02:00
Laurent Destailleur
82908a30eb Clean phan warnings 2024-05-30 13:37:17 +02:00
Laurent Destailleur
4b5b4c4e1a Clean some expected warnings 2024-05-13 12:49:14 +02:00
Laurent Destailleur
d523cb24e6 Disable useless phan warnings 2024-05-10 11:48:27 +02:00
Frédéric FRANCE
26da44e254 fix phpstan (#29431)
* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* remove params not used

* add WARNING
2024-04-27 12:45:50 +02:00
Laurent Destailleur
ca65e9a333 QUAL the config_extended of phpstan will be kept on apstats only for the
moment: Too many CTI error not related to PR.
2024-04-24 21:44:58 +02:00
Laurent Destailleur
a669c3d3fa Disable PhanUndeclaredGlobalVariable 2024-04-24 20:56:41 +02:00
Laurent Destailleur
5166eee88c Clean code 2024-04-24 20:29:37 +02:00
Laurent Destailleur
ba25317a97 Exclude PhanDeprecatedProperty for the moment 2024-04-05 10:22:01 +02:00
MDW
a703ea1092 Add checks on dol_(mktime|now|print_date) + avoid duplicate phan conf 2024-03-27 10:18:39 +01:00
Laurent Destailleur
414c51d631 Update config_extended.php 2024-03-24 16:38:51 +01:00
Laurent Destailleur
d78bafe602 Update config_extended.php 2024-03-24 16:38:21 +01:00
MDW
a1ae115757 Set cache_codes global type 2024-03-24 15:40:25 +01:00
MDW
02960415cb Fix global typing of menumanager as MenuManager 2024-03-24 11:03:22 +01:00
MDW
2a13f7134c Qual: Add extra phan stubs fixing PhanUndeclaredClassMethod 2024-03-23 14:29:54 +01:00
MDW
04d7142463 Disable HTML plugin (detects HTML in PHP files)
# Disable HTML plugin (detects HTML in PHP files)

These messages are not really useful for dolibarr.
2024-03-19 18:09:19 +01:00
MDW
cd3ea72f96 Qual: Disable global variable suggestion for $website 2024-03-19 02:44:07 +01:00
MDW
3c968477cb Change type of global $website to string 2024-03-19 02:44:04 +01:00
MDW
686facd74d Fix PhanPluginWhitespaceTrailing + format code + minor spelling 2024-03-17 21:35:08 +01:00
MDW
aa5aa2bf26 Add one more index to the theme_datacolor 2024-03-17 19:49:10 +01:00
MDW
d73886281c Qual: Set typing for global 2024-03-17 18:56:44 +01:00
MDW
97f4e4f462 Qual: Disable PhanPluginDuplicateCatchStatementBody which requires PHP7.1 for fix
# Qual: Disable PhanPluginDuplicateCatchStatementBody which requires PHP7.1 for fix

To fix this PHP7.1 is required, so skipping the message in the extended
report as well.
2024-03-14 20:05:32 +01:00
Francis Appels
75e99a6dee Fix phan tool for shipping 2024-03-12 11:21:42 +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
Laurent Destailleur
bb6cf2c6ed Fix warning 2024-03-08 23:00:55 +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
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
MDW
0d60041d8f Qual: Add custom phan plugin to detect var_dump (#28420)
# Qual: Add custom phan plugin to detect var_dump

This adds a custom plugin to detect the presence of var_dump.

Also disable a standard plugin in the extended configuration
(avoid reporting suggestions to add typing to the function
definitions (/declarations).
2024-02-25 22:11:25 +01:00
MDW
8655d5a86b QUAL Use phan to help detect new issues (#27706)
* Qual: Add phan flow

- Add phan configuration (config, baseline, stubs);
- Add github action;
- Update apstats.php.

* Add directives to ignore false phan notices

* Qual: Add typing hints for extrafields TPL files

# Qual: Add typing hints for extrafields TPL files

Add typing hints for phan on view files

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-21 18:14:29 +01:00