# Qual: Ignore PhanTypeSuspiciousNonTraversableForeach
PhanTypeSuspiciousNonTraversableForeach reports on the use of
`foreach ($object as $key => value)` which is valid accross
tested php versions (at least since PHP7.0).
So suppressing this notice.
* Qual: Nullable mysoc hint
# Qual: Nullable mysoc hint
$mysoc can be nullable resulting in issues (#31387) so
it is best to detect these cases with static analysis
* Prevent null assignment
* Qual: Fix several phan & stan notices
# Qual: Fix several phan & stan notices
Several fixes in files while fixing UnknownClass notices
* Qual: Update prepare_head PHPDoc return types
# Qual: Update prepare_head PHPDoc return types
Provide detailed array return types for prepare_head functions.
* Fix new phan notice
* Better loadLangs typing and fix call to loadLangs
* Fix new issues (stats)
* Other fixes of new issues
* Qual: update phan baseline
* ci: Automatically determine version for upgrade sequence
This automatically determines the version for the upgrade process
to help avoid editing the scripot on version upgrades.
* Include filefunc.inc.php to md5sum, remove old som computation
# Fix undefined global varialbe user/card.php
Fix a few issues, one of which noticed in V21 UI.
Also notified by phan:
```
htdocs\user\card.php:626 PhanUndeclaredGlobalVariable Global variable $mesgs is undeclared
htdocs\user\card.php:2967 PhanUndeclaredGlobalVariable Global variable $soc is undeclared
```
# Fix: Cope with undefined country key in search array
Fix:
```
htdocs\partnership\partnership_list.php:533 PhanUndeclaredProperty Reference to undeclared property \Partnership->login
htdocs\partnership\partnership_list.php:793 PhanTypeMismatchArgumentProbablyReal Argument 4 ($filter) is null of type null but \FormAdmin::select_language() takes array|string[] (no real type) defined at htdocs\core\class\html.formadmin.class.php:74 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
```
# Qual: Fix ci (phpstan notice)
While fixing the ci notice, also fixed the array definitions
which fixes both phan notices and phpstan notices seen on cti.
Removed the exception for phan on this file
# Qual: Fix phan/stan notices in relation with UnknownObjectMethodCall
Fix notices in classes with UnknownObjectMethodCall notices or classes
related with these.
# Qual: Fix phan notices
Fix phan notices in several classes that have UnknownObjectMethod calls and classes
that had notices in relation with these classes
* 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>
* Qual: Fix notifications multiple files
# Qual: Fix notifications multiple files
Fixes to files with UnknownObject notices, fixing other
notices in these files as well
* Improve boxes typing
* Qual: Extend accepted types to reduce notices
* Fix type for GET/POST arguments of GETPOST* calls
* Qual: More specific ignoreErrors for phpstan
# Qual: More specific ignoreErrors for phpstan
More specific ignore expressions helps identify new exceptions that
would have matched the more generic ignore expressions.
It also helps to progressively solve phpstan notices
in smaller steps by modifying the expressions
* CamelCase for dictFieldList
* Update phan baseline
# Qual: Fix Plugin ParamMatchRegexPlugin when classname is variable
Fix a case where the plugin throws an undefined variable because the
classname in the php source is variable
* Qual: Fix getTooltipContentArray typing hints
# Qual: Fix getTooltipContentArray typing hints
This defines the aray type for all getTooltipContentArray occurences
* Ignore undeclared property ref_supplier (does not exist on OrderLine)
* Qual: Fix Array of tabs typing hints
# Qual: Fix Array of tabs typing hints
Fixed same typing hints accross several files
* Qual: Fix pdf.lib.php, project.lib.php and related files
# Qual: Fix pdf.lib.php, project.lib.php and related files
Fix most phan notices for pdf.lib.php and project.lib.php.
And fixed some items in other files in the process
* Qual: Fix notifications commande/card advtarget.tpl fichinter/card societe/card supplier_proposal/card
* Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related
# Qual: Fix notices for FormSms, RssParser, ExpenseReportIk and related
Fix notices in the files for the classes above and other files to accomodate
these changes/fixes
# Qual: Update baseline for phan (because of fixes)
Several fixes to the code (mostly related to phpstan notices) also
fixed several phan notices which are removed from the baseline
with this change.
# Qual: Update copyright alignment
One can observe that copyright statements already generated are manually
aligned to the shorter statements in the file.
32 characters (or 8 tabs) was considered the maximum width for the
name column in the entire codebase and used to generate the new
copyright notices.
However, this is often shortend.
This update makes the fixcopyrightheader.php check the copyright notices
already present in the file and adapt the new notice to those
* Qual: 🛟 Fix typing
Qual: Fix typing
Fix some typing currently failing ci in develop.
* Fix typing for grabimages
* Qual: Fix new UndeclaredGlobalVariable notices & enable
# Qual: Fix new UndeclaredGlobalVariable notices & enable
This fixes several new notices regarding 'undeclared globals' which
mostly correspond to missing initialisations in views and some real
bugs where the variable name was incorrect.
Some less obvious cases are unsolved and ignored (adherents/list,
and fourn/commande/card).
This is in preparation of fixing the notices in the other files
where the baseline was already set to ignore them where most just
need a phan-var-force declaration which will help with verifying
type compatibity and object member verifications
* Qual: PhanPluginUnknownObjectMethodCall where it is the only phan notice
# Qual: PhanPluginUnknownObjectMethodCall where it is the only phan notice
Fix PhanPluginUnknownObjectMethodCall in files where it is the only phan notice
* Update phan baseline
* Fix $website global type in some contexts
* Fix extraparams property typing
* Fix argument typing
* Fix 'status' argument type in calls to dolGetButtonTitle
* Fix argument2 for price to 1 (was 2)
* Fix deliveryreceipt argument
* Fix PHPDoc dol_sort_array
* Fix range for int argument
* Fix arg type for str_pad and add some PHPDoc
* Fix natsort value for dol_sort_array
* Fix arguments on calls to dol_sort_array
* Reduce phpstan exceptions
* Qual: Add type hints for Stripe objects
# Qual: Add type hints for Stripe objects
Suggest the more specific implementation of the StripObject.
* Typing, initialisation
* Qual: Fix undeclared variables
* Update phan baseline
* Update baseline
* Qual: Add type hints for Stripe objects
# Qual: Add type hints for Stripe objects
Suggest the more specific implementation of the StripObject.
* Add PHPDoc for host class properties
* Ignore false positive (phan) for deprecated property
* Improve typing
* Update baseline
* Qual: Fix phan notices in actions_massactions.inc
# Qual: Fix phan notices in actions_massactions.inc
This fixes up the notices in htdocs/core/actions_massactions.inc.php
Separated from #30733.
* Adjust baseline for actions_massactions.inc improvements
* Update actions_massactions.inc.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Qual: 🛟 Fix reference to $db with $this->db
# Qual: reference to $db with $this->db
$db was undeclared, use $this->db.
* Fix suspected issue with environment max size and md5sum working on limited files
* Qual: Fix LDAP typing
* Qual: Fix some phan typing related to getNextValue()
# Qual: Fix some phan typing related to getNextValue()
This fixes a few typings in relation to getNextValue().
* Update phan baseline
* PHPDoc: set arguments as nullable (+update array types)
* Improve PHPDoc
* Force toselect type to int[]
* Enable all phan notices on actions_massactions.inc.php
* Test was wrong, can not count when it's not an array
* Update baseline
* Remove ignore for notice that no longer exists
* Update baseline
* Fix format argument
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>