2
0
forked from Wavyzz/dolibarr
Commit Graph

107 Commits

Author SHA1 Message Date
MDW
32bf8c5cd5 Qual: Fix phan notices (website) 2025-02-27 11:40:42 +01:00
MDW
97099b854f Qual: Fix phan notices (install) 2025-02-05 01:43:41 +01:00
MDW
ba32606084 Fix return value for getListOfCollation() 2025-01-24 10:55:47 +01:00
Laurent Destailleur (aka Eldy)
f0ae6b999f Debug v21 2025-01-03 15:55:05 +01:00
MDW
ec2a1928ba Qual: Update fields phpdoc to include fields that are defined/used in some cases
# Qual: Update fields phpdoc to include fields that are defined/used in some cases

comment, copytoclipboard, autofocusoncreated are documented and used in some cases for the
$fields definition
2024-12-05 02:36:50 +01:00
Frédéric FRANCE
1adc883b56 add baseline exclude for phpstan (#31632)
* add baseline exclude for phpstan

* update

* update

* update

* update

* update

* merge

* restore one filter

* delete old errors

* fix

* fix

* fix

* $moreforfilter can t be empty

* fix

* enable check

* refresh baseline

* add phpdoc

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-04 23:53:20 +01:00
MDW
b91c99b18a Qual: Fix phan/phpstan notices in class files (part 3) (#31578)
* fix phpstan in conf class (#31630)

* fix phpstan

* fix phan

* Fix merge

* Qual: Avoid notification with typing hint

* Qual: Fix notices link.class

* Qual: Fix notices link..socialneetworkmanager.class and DoliDb->DoliDB

* Qual: Fix notices for link..utils.class

* Qual: Fix notices for db classes

* Update translate.class.php

* Update translate.class.php

---------

Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com>
Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-10-29 22:44:47 +01:00
MDW
42bb4fbf3e Qual: Enable & fix or ignore Invalid DimOffset (#31176)
* Qual: Enable & fix or ignore Invalid DimOffset

# Qual: Enable & fix or ignore Invalid DimOffset

The Invalid DimOffset notices occur when array keys are defined and
the index used is not amongst the known array keys.

This PR enables these notices and fixes array definitions when needed,
or ignores the notices locally if it's a false positive, or in the
baseline.txt when it does not seem to be a false positive so that
it can be fixed later

* Nullable object typing in function signature not ok for 7.0/8.4

Can't user '?User' as argument type for PHP7.0 which is required by PHP8.4.
Therefore, removing the typing specification in the function definition

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-09-29 21:52:31 +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
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
d6948077b2 Qual: Fix spelling/update .pre-commit configuration (versions) (#30546)
* Qual: Update pre-commit configuration

* Qual: Update spelling

* Ignore use of deprecated constant
2024-08-07 01:20:43 +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
Laurent Destailleur
8963940c20 Fix phan 2024-04-28 17:38:39 +02:00
Laurent Destailleur
2aea004cba Fix phan 2024-04-28 17:36:33 +02:00
Laurent Destailleur
d1d68fdf8a Fix phan 2024-04-28 17:24:31 +02:00
Laurent Destailleur
6358f89c0d Fix phan warnings 2024-04-28 17:10:51 +02:00
Laurent Destailleur
2691603345 Doxygen 2024-04-27 18:04:27 +02:00
Laurent Destailleur
0d6675114e Merge branch 'develop' into qual/db/typing 2024-03-21 13:19:51 +01:00
Laurent Destailleur
380c1092eb Fix warnings 2024-03-21 13:19:31 +01:00
Laurent Destailleur
f3e6b38d9d Fix warning 2024-03-21 13:16:59 +01:00
Laurent Destailleur
e97f0a7668 Merge branch 'develop' into qual/db/typing 2024-03-21 13:06:35 +01:00
Laurent Destailleur
58e719eb56 Fix sanitization 2024-03-21 13:03:30 +01:00
Laurent Destailleur
5fa2bfff2e Merge branch 'develop' into qual/db/typing 2024-03-21 12:55:20 +01:00
Laurent Destailleur
61eefe5fa9 Merge branch 'develop' into fix/PhanTypeMismatchReturnNullable 2024-03-21 12:51:27 +01:00
Laurent Destailleur
04d8a20b63 Merge branch 'develop' into qual/db/typing 2024-03-21 12:46:25 +01:00
Laurent Destailleur
aa77573cd9 Sanitize DDL instructions 2024-03-21 12:45:58 +01:00
Laurent Destailleur
ce2959b022 Clean method DDLCreateTable (used by modulebuilder only) #28996 2024-03-21 12:10:09 +01:00
MDW
fc6af20479 Update typing for database functions 2024-03-21 00:00:00 +01:00
MDW
942239b5d6 Update PHPdoc to show nullable return 2024-03-20 23:54:32 +01:00
MDW
66c592717d Fix PhanTypeMismatchBitwiseBinaryOperands by typing argument 2024-03-17 20:12:35 +01:00
MDW
9eed23c6d0 Fix return type by cast or typing update
# Fix return type by cast or typing update

Fix most PhanTypeMismatchReturn notifications.

The remaining ones are likely real bugs or need more Dolibarr
knowledge to fix them efficiently
2024-03-16 13:52:12 +01:00
MDW
0b19aa415c Fix: Initialise array before assigning values (#28728)
* Qual: Enable PhanUndeclaredVariableDim

# Qual: Enable PhanUndeclaredVariableDim

The notifications are fixed in the code so the detection no longer
needs to be suppressed in the default flow

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Qual: Add type hint to array to avoid phan notification

* Qual: Add type hint to array to avoid phan notification

* Qual: Enable PhanParamSpecial1 (all resolved)

* Qual: Ignore false PhanTypeArraySuspiciousNullable

* Qual: Improve typing to fix PhanTypeArraySuspicious

* Qual: Fix PhanTypeArraySuspicious by replacing null assignment with empty array

* Qual: Fix PhanTypeArraySuspicious by testing as instancof DebugBar

* Qual: Fix PhanTypeComparisonToArray with enhanced typing

* Qual: Fix PhanTypeComparisonToArray with enhanced typing

* Qual: Enable phan messages that no longer appear

* Qual: Exclude phan stubs from codesniffer ruleset
2024-03-09 16:32:02 +01:00
MDW
89004f7e03 Qual: Spelling htdocs/core (#27491)
Highlights:
- initialY in pdf_standard.modules.php was unused
  - remove (otherwise -> initially) (+same in other file)
2024-01-13 19:48:20 +01:00
Laurent Destailleur
8874ef8454 Debug v19 2023-12-23 18:47:38 +01:00
Frédéric FRANCE
61b79fda17 avoid phpstan error with phpdoc 2023-12-06 15:46:39 +01:00
Laurent Destailleur
2eb630cd00 Fix with php-cs-fixer 2023-12-04 12:05:02 +01:00
Frédéric FRANCE
53c8a3acf8 clean phpdoc for phpstan (#26905) 2023-12-01 19:51:32 +01:00
MDW
3c966469ef QUAL No return values in __construct(), correct PHPDoc for typing (#26768) 2023-11-20 23:47:06 +01:00
Laurent Destailleur
630e305161 Standardize db drivers. No more static class. 2023-08-04 04:18:59 +02:00
Laurent Destailleur
a30242eadc Merge pull request #24507 from frederic34/repair_script
NEW repair script skip views
2023-04-18 17:24:52 +02:00
Laurent Destailleur
f02ff3f774 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop 2023-04-15 02:29:01 +02:00
Laurent Destailleur
f425bd4654 Fix sqlforlike when searching with like and _ string 2023-04-15 01:24:50 +02:00
Frédéric FRANCE
834cb83047 NEW repair script skip views 2023-04-14 10:06:10 +02:00
FLIO
02f4f47083 fix (qodana) Return value type is not compatible with declared 2023-01-24 23:11:28 +01:00
Laurent Destailleur
24fcb2ff16 The deprecated method escapeunderscore() of database handlers has been
removed. You must use escapeforlike instead.
2022-12-17 13:06:22 +01:00
Laurent Destailleur
34da698537 FIX Import in upgrade when using a socialnetwork field. 2022-09-14 16:01:45 +02:00
Laurent Destailleur
25e70bead8 phpcs 2022-05-18 23:27:26 +02:00
Laurent Destailleur
ed2e1bda46 Clean code v16 2022-05-18 11:00:43 +02:00
Laurent Destailleur
bb436e556d Fix warnings 2021-12-21 15:23:56 +01:00
Laurent Destailleur
aab9c2e6ca Fix #yogosha7605 2021-11-11 18:20:31 +01:00